how to check if the window object exists in javascript code example
Example: how to know if window exists in nodejs
if(typeof window !== 'undefined') {
console.log("this should print only if window object actually exists")
}
if(typeof window !== 'undefined') {
console.log("this should print only if window object actually exists")
}