1.0.8 • Published 6 years ago

@kingjs/linq.take v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@kingjs/linq.take

Generates a sequence identical to another sequence up to a specified index.

Usage

Take the first 2 numbers in -2, -1, 0, 1, 2 like this:

var take = require('@kingjs/linq.take');
var sequence = require('@kingjs/enumerable.create');
var toArray = require('@kingjs/linq.to-array');

var result = take.call(sequence(-2, -1, 0, 1, 2), 2);

toArray.call(result);

result:

[-2, -1]

API

declare function take(
  this: Enumerable,
  count: number
): Enumerable

Interfaces

Parameters

  • this: The sequence.
  • count: The number of elements to take.

Return Value

A sequence of only the first count elements.

Install

With npm installed, run

$ npm install @kingjs/linq.take

Acknowledgments

Like Element.Take.

License

MIT

Analytics

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago