Skip to content

Instantly share code, notes, and snippets.

@kvirani
Forked from hora/average.js
Last active September 16, 2024 04:29
Show Gist options
  • Save kvirani/5ae6f3171b87acfb452bcf23e6f2dc41 to your computer and use it in GitHub Desktop.
Save kvirani/5ae6f3171b87acfb452bcf23e6f2dc41 to your computer and use it in GitHub Desktop.
Debugging Errors
function average(list) {
var sum = 0;
for (var num of list) {
sum ++ num;
}
return sum / list.length;
console.log(average([3, 5, 7]));
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