var items = ['eggs', 'milk']; items.unshift('bread') gs.print(items); // [ 'bread', 'eggs', 'milk' ]
Output:
unshift() adds a new element to the start of the array
Working Code Asked question July 20, 2023
var items = ['eggs', 'milk']; items.unshift('bread') gs.print(items); // [ 'bread', 'eggs', 'milk' ]
Output: