how to get last item of arry javascript code example Example: javascript get last element of array console.log(2)