How to handle ‘undefined’ in JavaScript [duplicate] January 22, 2023 by Tarik You can check the fact with if (typeof jsVar == 'undefined') { ... }