Consider the following array:
var john = ['asas','gggg','ggg'];
If an attempt is made to access john
at index 3, i.e. john[3]
, it results in an error.
Is there a way to show a message or trigger an alert indicating that there is no value stored in that particular index?