I'm having a code where I pass a value and I need to check if this value exists within array
, so I use indexOf
. What I would like is to get the value that indexOf
finds, for example:
org = 3;
var array_t = [1,2,3,4,5];
receb = (array_t.indexOf(org));
In this case it will show that 3 is in position 2 . What I want is to get the value 3 . It's possible?