last index of array js

JavaScript
var last = arr.slice(-1)[0]array.lastIndexOf(searchElement[, fromIndex]);

Source

Also in JavaScript: