IndexOf finds an item in an array to perform (absolute comparison)
January 27, 2024
by Melissa Mitchell
No Comments
Var arr=[NaN,'2', 1, 3]; console.log(arr.indexOf(NaN)); Console.log (arr.indexof (2)); //-1, NaN is compared to NaN in the array,NaN is not equal to NaN,NaN is not equal to any data type.Copy the code