Underscore shouldn't be able to iterate over the letters of a string cross-browser -- indexing into a string isn't supported in IE

This commit is contained in:
Jeremy Ashkenas
2009-12-08 17:31:01 -05:00
parent 0ed4212ec6
commit 3eb9c28039

View File

@@ -15,10 +15,6 @@ $(document).ready(function() {
_.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5});
equals(answers.join(', '), '5, 10, 15', 'context object property accessed');
answers = [];
_.each("moe", function(letter){ answers.push(letter); });
equals(answers.join(', '), 'm, o, e', 'iterates over the letters in strings');
answers = [];
_.forEach([1, 2, 3], function(num){ answers.push(num); });
equals(answers.join(', '), '1, 2, 3', 'aliased as "forEach"');