How to check if a variable is undefined in JavaScript
The proper way to check if a variable exists in JavaScript. The following code does it:
if( typeof yourVariable === 'undefined' ) { // Your variable is undefined }
The proper way to check if a variable exists in JavaScript. The following code does it:
if( typeof yourVariable === 'undefined' ) { // Your variable is undefined }
Log in or create a user account to post a comment.