/arrayjs

A javascript implementation of Linq to Objects

Primary LanguageJavaScript

array.js is a javascript implementation of linq. It has support for deferred execution for browsers that do not support Javascript 1.7.

#method chaining
    var source = [ 1, 2, 3, 3, 2, 2, 3, 1, 0, 5 ];
    var result = source
                       .where(function(x) { return x < 4; })
                       .skip(2)
                       .distinct();

#deferred execution
    var source = [ 1, 2, 3, 3, 2, 2, 3, 1, 0, 5 ];
    var result = source.where(function(x) { return x < 4; });
    
    //it's only executed on toArray() or whenever
    //the element is enumerated
    console.log(result.toArray());