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
-
Enumerable
: See @kingjs/enumerable.define.
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
License
MIT