8 examples of 'jquery append array' in JavaScript

Every line of 'jquery append array' 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
1function append(array, value) {
2 array.push(value);
3 return array;
4};
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

47export function append<T>(array: Arrayable<T>, item: T): Arrayable<T> {
48 return splice(array, array.length, 0, item)
49}
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}
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}
104function push (array, value) {
105 array.push(value)
106 return array
107}
49function unshift (elem, arr) {arr = arr.slice(); arr.unshift(elem); return arr;}
55function concatArray(array) {
56 var each = tinymce.each, result = [];
57 each(array, function (item) {
58 result = result.concat(item);
59 });
60 return result.length > 0 ? result : array;
61}
1export function append(el, list){
2 if (arguments.length === 1) return _list => append(el, _list)
3
4 if (typeof list === 'string') return `${ list }${ el }`
5
6 const clone = list.slice()
7 clone.push(el)
8
9 return clone
10}

Related snippets