I have an array of numbers 1-20. When I use indexOf and try to find the position of "2", it says it's at 3(correct).
I have a variable called day = 2. When I use the code array.indexOf(day), it returns -1.
Why is this happening?
I have an array of numbers 1-20. When I use indexOf and try to find the position of "2", it says it's at 3(correct).
I have a variable called day = 2. When I use the code array.indexOf(day), it returns -1.
Why is this happening?
Copyright © 2021 Jogjafile Inc.