push
优质
小牛编辑
137浏览
2023-12-01
Returns a new sequence with the same elements as this one, plus the specified element at the end.
Signature
ArrayLikeSequence.push = function() { /*...*/ }
ArrayLikeSequence.push = function push(value) { return this.concat([value]); }
Name | Type(s) | Description |
---|---|---|
returns | ArrayLikeSequence | The new array-like sequence. |
Examples
Lazy([1, 2]).push(3) // sequence: [1, 2, 3] Lazy([]).push(1) // sequence: [1]