Since NaN === NaN evaluates to false, is it possible to add a NaN case to a switch statement?
NaN === NaN
false
NaN
switch
For example, let\'s say
use toString():
switch (x.toString()) { case '1': case '2': case '4': console.log('1/2/4'); break; case 'NaN': console.log('NaN'); break; default: console.log('default'); }