Why are the results returned by the two operations inconsistent, and why is it not NaN?

var a = 9/0;
a;
Infinity
typeof a;
"number"



typeof 9/0;
NaN
typeof NaN
"number"
Mar.09,2021

priority ratio of

typeof


typeof (9pm 0) is' number'
Infinity is infinity, is a number


similar

var a = 1;
typeof a*1

 NaN
var a = 1;
typeof (a*1)
NUmber

the reason is that the parameters after typeof do not participate in the calculation, so typeof 9 Infinity 0, 9, typeof (0 he will not calculate the result, so NaN is not a number
after adding parentheses, it will first calculate, typeof (9 Infinity 0, and then typeof Infinity is Number

.

see MDN description

Key description on

MDN (clasp): the
typeof operator returns a string indicating the type of uncalculated Operand.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b405aa-ea58.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b405aa-ea58.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?