initial implementation of _.range

This commit is contained in:
Kirill Ishanov
2009-12-01 00:44:13 +03:00
parent 67f1e8a9c8
commit d8cf99ba89
2 changed files with 18 additions and 0 deletions

View File

@@ -2,6 +2,10 @@ $(document).ready(function() {
module("Collection functions (each, any, select, and so on...)");
test("generators: range", function() {
equals(_.range(4).join(' '), '0 1 2 3 4', 'range with positive number generates an array of of elements 0,1,2,...,n');
});
test("collections: each", function() {
_.each([1, 2, 3], function(num, i) {
equals(num, i + 1, 'each iterators provide value and iteration count');