bloodyowl/craft

Array#select should store `self[index[` in a var to avoid `fn` tampering with its value.

jdalton opened this issue · 0 comments

Array#select should store self[index[ in a var to avoid fn tampering with its value.

This

if(fn.call(context, self[index], index, self) === true) filtered.push(self[index])

should be

var value = self[index];
if(fn.call(context, value, index, self) === true) filtered.push(value)