Created
May 1, 2018 21:01
-
-
Save escottalexander/64fd837ecf9498cefba837f25b063df3 to your computer and use it in GitHub Desktop.
This file contains 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 characters
https://repl.it/@ElliottAlexande/min-and-max-without-sort-drill | |
https://repl.it/@ElliottAlexande/average-drill | |
https://repl.it/@ElliottAlexande/fizzbuzz-drill-js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm totally violating the instructions, but here's a fun option:
Notice that
Math.max
implicitly attempts type conversion, from strings to numbers.Your solution is great! But there's room for a small improvement.
In this case, the difference in performance is small, but real.
More importantly, it's best practice keep your code DRY (Do Not Repeat). DRY code can lead to quicker knowledge-share on a team, and fewer bugs because the values are traceable.