javascript access last array element code example Example: javascript get last element in array this = array[array.length - 1];