jashkenas/underscore

include returns incorrect result for undefined in IE

Closed this issue · 1 comments

Reproduce the issue with the following in developer tools console:
_.include([undefined],undefined)

Expected result: true

Result in IE 8: false

This is actually a rather infamous bug: IE <= 8 treats undefined array elements as elisions—it's as if you wrote _.include(Array(1), undefined), which is false in all browsers. Nothing much to be done, I'm afraid.