@kingjs/linq.element-at

Returns the element at a specified index in a sequence.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@kingjs/linq.element-at
1.0.94 years ago4 years agoMinified + gzip package size for @kingjs/linq.element-at in KB

Readme

@kingjs/linq.element-at
Returns the element at a specified index in a sequence.

Usage

Return the 2nd element in the sequence 0, 1, 2 like this: ```js var elementAt = require('@kingjs/linq.element-at'); var sequence = require('@kingjs/enumerable.create'); elementAt.call(sequence(0, 1, 2), 1); ``` result: ```js 1 ```

API

```ts declare function elementAt( this: Enumerable, index: number ): any ```

Interfaces

Parameters

  • this: The sequence to traverse.
  • index: The 0 based index of of the sequence to return.

Return Value

The 0 based index of of the sequence or an exception if the sequence is too short.

Install

With npm installed, run ``` $ npm install @kingjs/linq.element-at ```

See Also

Like Enumerable.ElementAt.aspx).

License

MIT Analytics