Created
August 12, 2021 00:41
-
-
Save sorie/9b47bf24a27bc8671f5a70e371b3f54a to your computer and use it in GitHub Desktop.
Revisions
-
sorie created this gist
Aug 12, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ //bad code function getResult(score) { let result; if(score > 5) { result = 'up'; } else if (score <= 5) { result = 'down'; } return result; } //good code function getResult(score) { return score > 5 ? 'up' : 'down'; }