get last entry from array js code example Example: javascript get last element of array var array = [1,2,3,4,5,6]; var val = array[array.length - 1]; // 6