You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> a := [1, 2, x]
> x IN a
FALSE
> a := [1, "two", x]
> x IN a
TRUE
The problem here is that in the first case, the literal array is resolved to type "array of number", because every array element can be converted to Number. So although a is declared as Array<Object>, the literal array starts off as Array<Number> and then is converted to Array<Object>.
In the second case, the literal array is resolved as "array of object" because the types are different. So the identity of x remains the same in the array and x IN a is true.
The text was updated successfully, but these errors were encountered: