Error: array.reduce(...) is not a function
See original GitHub issueChallenge http://www.freecodecamp.com/challenges/waypoint-condense-arrays-with-reduce has an issue.
Error: array.reduce(…) is not a function
My code:
var array = [4,5,6,7,8];
var singleVal = 0;
// Only change code below this line.
singleVal = array.reduce(function(prev, cur) {
return prev + cur;
})
// Only change code above this line.
(function() {return(singleVal);})();
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
TypeError: this.reduce is not a function [duplicate]
This is happening because you are using for..in on an array. You shouldn't be doing that. When you added Array.prototype.xintsum , you added ......
Read more >Error: array.reduce(...) is not a function · Issue #2427 - GitHub
Error : array.reduce(...) is not a function My code: var array = [4,5,6,7,8]; var singleVal = 0; // Only change code below this...
Read more >TypeError: Reduce of empty array with no initial value
The JavaScript exception "reduce of empty array with no initial value" occurs when a reduce function is used.
Read more >Array.reduce not a function? - Google Groups
in a reduce function as part of a M / R call? I know that V8 (and. Node.js) accept a reduce call, but...
Read more >TypeError: e.reduce is not a function error - Prismic People
Hi Mitchel,. This error occurs when you pass anything other than a Rich Text field to the asHtml helper function. Looking at your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@BerkeleyTrue, Agreed about the semicolons but is it possible to have a better error displayed? Right now it just says
YYY is not a function
and that isn’t really helpful in this situation.But I still think what this is a bug. Semicolons isn’t necessary in EcmaScript. Result should not depend on semicolons. Or, at least, error must be more verbose.