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 check if an input is an integer ?

Leave a Reply

Your email address will not be published. Required fields are marked *

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