If I wanted to implement a variable check whenever I was to use the .indexOf()
method of javascript would it be possible?
For example, using a.indexOf(b);
can detect when a
is null
or undefined
and change method to return -1
?