Skip to content

Latest commit

History

History
40 lines (30 loc) 路 569 Bytes

usage.md

File metadata and controls

40 lines (30 loc) 路 569 Bytes

Usage

JavaScript

// Using require
const collect = require('collect.js');

collect(products)
  .where('price', '>', 299)
  .sortBy('brand');
// Using import
import collect from 'collect.js';

collect(products)
  .where('price', '>', 299)
  .sortBy('brand');
// Using the underlying class
import { Collection } from 'collect.js';

new Collection(products)
  .where('price', '>', 299)
  .sortBy('brand');

TypeScript

import collect from 'collect.js';

collect(products)
  .where('price', '>', 299)
  .sortBy('brand');