how to get last object in arraylist javascript code example Example: java last element in array arrayName[arrayName.length() - 1];