tj / node-querystring

querystring parser for node and the browser - supporting nesting (used by Express, Connect, etc)
MIT License
455 stars 66 forks source link

make forEach and reduce shims slightly more compliant #79

Closed ljharb closed 10 years ago

ljharb commented 10 years ago

ES5 array iterators take 3 args: value, index, and array.

I haven't yet added support for the 4th optional "context" arg.

In addition, if the initial value is not supplied to reduce, the first value from the array is used, and iteration begins with the second value.

tj commented 10 years ago

they're only used internally so it's not a big deal if they match the real thing