@kingjs/linq.prepend

1.0.6 • Public • Published

@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

License

MIT

Analytics

Readme

Keywords

none

Package Sidebar

Install

npm i @kingjs/linq.prepend

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

3.03 kB

Total Files

4

Last publish

Collaborators

  • kingces95