10 examples of 'array_push' in JavaScript

Every line of 'array_push' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
1758function arrayPush(array, values) {
1759 var index = -1,
1760 length = values.length,
1761 offset = array.length;
1762
1763 while (++index < length) {
1764 array[offset + index] = values[index];
1765 }
1766 return array;
1767}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

168function arrayPush(array, values) {
169 var index = -1, length = values.length, offset = array.length
170
171 while (++index < length) {
172 array[offset + index] = values[index]
173 }
174 return array
175}
104function push (array, value) {
105 array.push(value)
106 return array
107}
492private static arrayPush( array: any[], values: any[] ): any[] {
493 var index = -1,
494 length = values.length,
495 offset = array.length;
496
497 while ( ++index < length ) {
498 array[ offset + index ] = values[ index ];
499 }
500 return array;
501}
20pushMultiple(arr) {
21 this.items.push.apply(this.items, arr);
22 arr.length = 0;
23 return this;
24}
1function pushUnique(arr, item) {
2 if (arr.indexOf(item) !== -1) {
3 throw 'Item already registered.';
4 }
5 arr.push(item);
6}
20function pushMany(a, list) {
21 Array.prototype.push.apply(a, list);
22}
9push(element) {
10 this.stack.push(element)
11}
183function push(arr, fnCb) {
184 var op = [new ListInsertOp(segments, arr.length, value)];
185 shareDoc.submitOp(op, fnCb);
186 return arr.length;
187}
123function push (args) {
124 args = [].slice.call(arguments);
125 window._lnq.push(args);
126}

Related snippets