@hexlet/linq

0.1.2 • Public • Published

js-linq

github action status Code Climate

Install

npm install @hexlet/linq

Usage example

import HexletLinq from '@hexlet/linq';

const cars = [
  { brand: 'bmw', model: 'm5', year: 2014 },
  { brand: 'bmw', model: 'm4', year: 2013 },
  { brand: 'kia', model: 'sorento', year: 2014 },
  { brand: 'kia', model: 'rio', year: 2010 },
  { brand: 'kia', model: 'sportage', year: 2012 },
];
const coll = HexletLinq.from(cars);

const result = coll.orderBy(car => car.year, 'desc')
  .where(car => car.brand === 'kia')
  .select(car => car.model);

result.toArray();
// ['sorento', 'sportage', 'rio']

For more information, see the Full Documentation

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet (in Russian).

Readme

Keywords

none

Package Sidebar

Install

npm i @hexlet/linq

Weekly Downloads

1

Version

0.1.2

License

ISC

Unpacked Size

13.7 kB

Total Files

4

Last publish

Collaborators

  • dzencot
  • grozwalker
  • mshkv
  • mokevnin
  • corsicanec82