Answers for "javascript type of object if"

5

javascript check if object

typeof yourVariable === 'object' // true if it's an object or if it's NULL.

// if you want to exclude NULL
typeof yourVariable === 'object' && yourVariable !== null
Posted by: Guest on January-11-2021
1

typescript check if object is of type

mySprite instanceof Sprite;
Posted by: Guest on December-03-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language