You can use the typeof operator to check if a value was undefined.
if (typeof name === "undefined") { // code here }
The typeof operator returns a string indicating the type of the unevaluated operand.
You can use the typeof operator to check if a value was undefined.
if (typeof name === "undefined") { // code here }
The typeof operator returns a string indicating the type of the unevaluated operand.