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.
let languages = ['C', 'C++', 'Java'];
let c = languages[0];
let cPlusPlus = languages[1];
let java = languages[2];


Write a function getFirstElement that takes an array and returns the first element of the array.

Example: getFirstElement([1, 2]) should return 1.