1.0.0 • Published 6 years ago
@kingjs/linq.element-at-or-default v1.0.0
@kingjs/linq.element-at-or-default
Return the element at a specified index in a sequence.
Usage
Return the 2nd element in the sequence 0
, 1
, 2
like this:
var elementAt = require('@kingjs/linq.element-at');
var sequence = require('@kingjs/sequence');
elementAt.call(sequence(0, 1, 2), 1);
result:
1
API
declare function elementAt(
this: Enumerable,
index: number
): any
Interfaces
Enumerable
: See @kingjs/sequence.
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 undefined.
Install
With npm installed, run
$ npm install @kingjs/linq.element-at-or-default
See Also
Like Enumerable.ElementAt.
License
MIT
1.0.0
6 years ago