-
-
Save potatowave/cc2f618ecea2d0878cd1c7e97ce93532 to your computer and use it in GitHub Desktop.
Debugging Errors
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
function average(list) { | |
var sum = 0; | |
for (var num of list) { | |
sum += num; | |
} | |
return sum / list.length; | |
} | |
console.log(average([3, 5, 7])); |
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
var input = process.argv[2]; | |
if (input) { | |
console.log(reverse(input)); | |
} | |
function reverse(original) { | |
return original.split('').reverse().join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment