I have been using Array.indexOf
in the Google Chrome console, I tried these codes
[1,2,3].indexOf(3);
[1,2,"3"].indexOf("3");
They all returned 2, but when I tried these codes
[1,2,"3"].indexOf(3);
[1,2,3].indexOf("3");
They all returned -1. I want it also return 2, how could I do that? Thanks for your help, time, and effort!
indexOf
– Doreathadoreen