Js does not recognize "null"

A text= "null" string comes from the front end of

. When using typeof text, it is of type string, but when judging whether it is "null", the result of text== "null" is always false,. How can we tell that it is a "null"?

Apr.03,2021

has been solved. I don't know why both typeof and instanceOf thought it was string, but then it was right to use text==null.


when you add double quotation marks (text= "null"), you already define text as a string. So it must be of the string type.

you can judge whether it is null or not.

if (text = null) {}


because text='null' is a string type; typeof (null) output type is object, and of course false is returned if it is not the same type!

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-1b385df-2b656.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-1b385df-2b656.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?