check if var is a node object code example
Example: 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
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