1

I have a form that I get with $('#formId') using jquery. This gives me an array of inputs elements in which I would like to use Array.prototype.reduce but apparently I can't. Why is that? Isn't the array returned by the jquery selector a "normal" array? And why I can use other Array.prototype methods like map, or filter and not reduce. Can anyone explain me the logic here?

António Quadrado
  • 1,307
  • 2
  • 17
  • 34
  • 1
    Duplicate tl;dr: it's not an array. jQuery [map](http://api.jquery.com/map/) and [filter](http://api.jquery.com/filter/) methods are not Array.prototype methods. – JJJ Jan 30 '17 at 13:17
  • 1
    can use `get()` to return a real array – charlietfl Jan 30 '17 at 13:22
  • I though that the jquery returned a normal array. didn't know about the 'wrapped set'. Thanks for pointing me to answer that explains it. Couldn't find it before. – António Quadrado Jan 30 '17 at 13:22

0 Answers0