how to add last index of array in js code example Example: last index of array js array.lastIndexOf(searchElement[, fromIndex]);