@kingjs/linq.prepend

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

Stats

StarsIssuesVersionUpdatedCreatedSize
@kingjs/linq.prepend
1.0.63 years ago3 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

  • 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

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.