@kingjs/linq.element-at-or-undefined

Returns the element at a specified index in a sequence or undefined if the index is out of range.

Stats

StarsIssuesVersionUpdatedCreatedSize
@kingjs/linq.element-at-or-undefined
1.0.63 years ago3 years agoMinified + gzip package size for @kingjs/linq.element-at-or-undefined in KB

Readme

@kingjs/linq.element-at-or-default

Returns the element at a specified index in a sequence or undefined if the index is out of range.

Usage

Return the 2nd element in the sequence 0, 1, 2 like this:

var elementAt = require('@kingjs/linq.element-at-or-undefined');
var sequence = require('@kingjs/enumerable.create');

elementAt.call(sequence(0, 1, 2), 1);

result:

1

API

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 undefined.

Install

With npm installed, run

$ npm install @kingjs/linq.element-at-or-default

See Also

Like Enumerable.ElementAt.

License

MIT

Analytics

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.