-1

Consider the following array : let trees = ['redwood', 'bay', 'cedar', 'oak', 'maple']; The output for 'bay' in trees is false.

Similary if I do something like above for the array containing numbers it is giving me unexpected output - let numbers = [1,2,3,4] .The output for 1 in numbers is true.

RVK
  • 19
  • 1
  • 3
  • _`'bay' in trees` // returns false (you must specify the index number, not the value at that index)_ - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in – evolutionxbox May 19 '22 at 07:51

0 Answers0