Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
199 B
1
Indexable
Never
function lastIndexOf(arr, val) {
    let LastIndex = -1
    for (let i = 0; i < arr.length; i++){
        if(arr[i] === val){
            LastIndex = i;
        }
    }
    return LastIndex
}