Add unshift function in Y.Array
unshift(Array<Object|boolean|Array|string|number|Uint8Array|Y.Type> inserts parameters to the beginning of the yarray
This commit is contained in:
parent
a70c5112cd
commit
821df42931
@ -163,6 +163,8 @@ position 0.
|
|||||||
</dd>
|
</dd>
|
||||||
<b><code>push(Array<Object|boolean|Array|string|number|Uint8Array|Y.Type>)</code></b>
|
<b><code>push(Array<Object|boolean|Array|string|number|Uint8Array|Y.Type>)</code></b>
|
||||||
<dd></dd>
|
<dd></dd>
|
||||||
|
<b><code>unshift(Array<Object|boolean|Array|string|number|Uint8Array|Y.Type>)</code></b>
|
||||||
|
<dd></dd>
|
||||||
<b><code>delete(index:number, length:number)</code></b>
|
<b><code>delete(index:number, length:number)</code></b>
|
||||||
<dd></dd>
|
<dd></dd>
|
||||||
<b><code>get(index:number)</code></b>
|
<b><code>get(index:number)</code></b>
|
||||||
|
@ -121,6 +121,15 @@ export class YArray extends AbstractType {
|
|||||||
this.insert(this.length, content)
|
this.insert(this.length, content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preppends content to this YArray.
|
||||||
|
*
|
||||||
|
* @param {Array<T>} content Array of content to preppend.
|
||||||
|
*/
|
||||||
|
unshift (content) {
|
||||||
|
this.insert(0, content)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes elements starting from an index.
|
* Deletes elements starting from an index.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user