The browser storage localStorage is not available. Either your browser does not support it or you have disabled it or the maximum memory size is exceeded. Without localStorage your solutions will not be stored.

Array: slice()

With slice you can copy a subarray from an array:
var abcd = ['a', 'b', 'c', 'd'];
var ab = abcd.slice(0, 2);
var bc = abcd.slice(1, 3);
var bcd = abcd.slice(1, 4);
The first parameter specifies the start index (included) and the second parameter specifies the end index (excluded). The original array will not be modified.

Exercise

Write a function halve that copies the first half of an array. With an odd number of array elements, the middle element should belong to the first half. halve([1, 2, 3, 4]) should return [1, 2].