Check if a Value Is Object in JavaScript | Delft Stack

PHOTO EMBED

Wed Feb 23 2022 10:56:54 GMT+0000 (UTC)

Saved by @arielvol #javascript

const test = {};
function isObject(val) {
    return val instanceof Object; 
}
console.log(isObject(test));
content_copyCOPY

https://www.delftstack.com/howto/javascript/check-value-is-object-in-javascript/