Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating resource.
Please try to avoid dependencies to third-party libraries and frameworks.
Implementation edit is for fixing errors and enhancing with metadata.
Instead of changing the code of the snippet, consider creating another JS implementation.
items = append([]T{x}, items...)
items = append(items, x) copy(items[1:], items) items[0] = x
items = [x, items]
items.insert(0,x);
items.unshift(x)
items.prepend(x)
unshift @items, $x
items = [x] + items
items = [x, ...items];
items2 = x : items
items.Insert(0, x);