assigned → closed
Replying to [comment:8 anonymous]:
just call $.map with a string: http://jsfiddle.net/aH4mU/
jQuery.map accepts arrays and objects, not strings.
Replying to [comment:9 Nigel]:
isArrayLike, even as a private function, should (IMHO) not throw an exception if passed a non array - it should return false. Surely the whole point of having it is to check if it is array like and do something else if not?
The whole point of having it is to identify those objects that should be iterated over by numeric index, generally to differentiate them from objects that should be iterated over with
for...in loops. We take pains to ''avoid'' passing in strings, and if you circumvent that by calling jQuery methods with invalid input, then (as [comment:7 dmethvin] said) "There are no guarantees what you'll get back".
And although we'd never add code to guarantee it, I consider throwing exceptions when a call steps outside the bounds of our documented API to be ''better'' behavior than silently propagating misconceptions.