How to find the index of NaN in array with JavaScript ES6

1 Answer

0 votes
const arr = ['w', 23, 'node.js', NaN];

console.log(arr.findIndex(x => Number.isNaN(x))); 



/*
run:
     
3
   
*/

 



answered Mar 11, 2020 by avibootz
...