-
-
Save kvirani/5ae6f3171b87acfb452bcf23e6f2dc41 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 orignal.split('').reverseList().join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment