Skip to content

hexlet-components/js-linq

Repository files navigation

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.

See most active contributors on hexlet-friends.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5