javascript last array value code example Example: javascript get last element in array var array =[1,2,3,4]; var last= array[array.length-1];