Skip to content

Instantly share code, notes, and snippets.

@DavidGinzberg
Created December 13, 2016 21:04
Show Gist options
  • Save DavidGinzberg/0fcf4bc32b67b56c4c78485023598fd4 to your computer and use it in GitHub Desktop.
Save DavidGinzberg/0fcf4bc32b67b56c4c78485023598fd4 to your computer and use it in GitHub Desktop.
// Each of these functions has something wrong with it. Why won't it work and how can it be fixed?
//Produces the product of all numbers in an array
function product(numbers){
var result = 0;
for(var i = 0; i < numbers.length; i++){
result *= numbers[i];
}
return result;
}
//more to come
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment