Holen Sie sich das letzte Element in Array in JS
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}
Clear Caiman
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}
var last = arr[arr.length - 1]
f (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}