Home >Web Front-end >JS Tutorial >How to determine undefined in JS (a good method)_javascript skills
I encountered a problem in a recent project. Let me share it with you.
After using servlet to assign the value to the text box of the HTML page, use alert to pop up the value. The result shows "undefined". So I naturally Use this value to compare with the string "undefined". Unfortunately, the comparison result is false.
There is no way, I can only google it and find a master.
It turns out that typeof must be used , the writing method is: