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.

Get array elements

The elements of an array are accessed by an index beginning with 0.
var languages = ['C', 'C++', 'Java'];
var c = languages[0];
var cPlusPlus = languages[1];
var java = languages[2];

Exercise

Write a function getFirstElement that takes an array and returns the first element of the array. getFirstElement([1, 2]) should return 1.