This package has been deprecated

Author message:

Please switch to the similar array-x package (https://www.npmjs.com/package/array-x)

lambda.js

2.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i lambda.js

Weekly Downloads

0

Version

2.0.2

License

MIT

Last publish

Collaborators

  • prmph