@kingjs/linq.prepend

Generates an sequence identical to another sequence but with a value added to the start.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@kingjs/linq.prepend
081.0.64 years ago4 years agoMinified + gzip package size for @kingjs/linq.prepend in KB

Readme

@kingjs/linq.prepend
Generates an sequence identical to another sequence but with a value added to the start.

Usage

Prepend 0 to the sequence 1, 2, 3 like this:
var prepend = require('@kingjs/linq.prepend');
var sequence = require('@kingjs/enumerable.create');
var toArray = require('@kingjs/linq.to-array');

var numbers = sequence(1, 2, 3);

var result = prepend.call(numbers, 0);

toArray.call(result);
result:
[0, 1, 2, 3]

API

declare function prepend(
  this: Enumerable,
  value
): Enumerable

Interfaces

Parameters

  • this: A sequence of values.
  • value: The value to prepend.

Return Value

Returns a sequence with value prepended.

Install

With npm installed, run
$ npm install @kingjs/linq.prepend

Acknowledgments

Like Enumerable.Prepend.aspx)

License

MIT
Analytics