DEV Community

Discussion on: 💡 How to check if a variable is undefined in JS

Collapse
 
benjaminmock profile image
Benjamin Mock

It might be because you don't know if a variable is declared or not. e.g. You have a global window object in the browser, but not in Node.js