DEV Community

Discussion on: Can You Guess the Result of This JavaScript Code?

Collapse
 
jaivardhanbhati profile image
Jai Bhati

return the index of the first element where there is no value present (undefined) in reverse order like 19..18..17...

Collapse
 
jaivardhanbhati profile image
Jai Bhati

This is why its the last index but internally the traversal is done from the reverse order