This is the ThingsDB documentation for version v0, click here for the latest version!


Adds new items to the start of a list, and returns the new length.

This function generates an event (except when called on a variable).


list.unshift(item1, item2, ..., itemX)

Return value

Returns the new length of the list.


This code inserts values to the start of a list:

list = [4, 5, 6];
list.unshift(1, 2, 3);  // Returns the new length, 6


Return value in JSON format

[1, 2, 3, 4, 5, 6]