2.0.2 • Published 8 years ago

lambda.js v2.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

lambda.js

Functional extension methods (inspired by LINQ .NET) on JavaScript arrays

THIS PACKAGE IS DEPRECATED! Please switch to the array-x package (https://www.npmjs.com/package/array-x)

Examples

require("lambda.js")(); // Note that, starting with version 2.0.0, the imported module function must be executed to extend the array type

var arr = [1, 2, 3, 4, 5, 6, 7];
arr.forAll((item) => console.log(item));
console.log(arr.select((item) => item * 10));
console.log(arr.where((item) => item > 4));

API

Array.prototype.forAll(function);

Array.prototype.select(function);

Array.prototype.distinct();

Array.prototype.where(function);

Array.prototype.all(function);

Array.prototype.any(function);

Array.prototype.accumulate(initial, function);

Array.prototype.firstOrDefault(function);

Array.prototype.first(function);

Array.prototype.lastOrDefault(function);

Array.prototype.last(function);

Array.prototype.union(array);

Array.prototype.orderBy(function);

Array.prototype.orderByDesc(function);

Array.prototype.sum(function);

Array.prototype.count(function);

Array.prototype.avg(function);

Array.prototype.max(function);

Array.prototype.min(function);

Array.prototype.groupBy(function);

Array.prototype.groupAggregate(key, value, aggregation);

Array.prototype.removeItem(item);

Array.prototype.removeAt(index);

Array.prototype.insert(index, item);

Install

npm install lambda.js --save

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago