Skip to content

TypeScript code snippet – How to know if window exists in nodejs?

if(typeof window !== 'undefined') {
  console.log("this should print only if window object actually exists")
See also  Java code snippet - How to change a string array in integer array?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.