In JavaScript on Chrome and Firefox:
isNaN( "\n" )
gives false
parseFloat ( "\n" )
gives NaN
The same is yielded for \t
, \r
and \f
.'
\n
is a number- Parsed
\n
gives you Not A Number. - Escaped characters such as the NULL byte
\0
,\\
and\"
do work as expected. - We know that
NaN
is a number, just not representable by any other value - So
\n
is a number, that's not representable.
Why do browsers implement it this way?