Code to go logo
Created using Figma
Use Cases
Contribute
How to check if variable is an object in JavaScript
Objects
By Jad Joubran ·
Last updated Dec 17, 2017
const value = { name: "John" }; Object.prototype.toString.call(value) === "[object Object]";
true
Dec 17, 2017
1
Jad Joubran
See answer
1
Jad Joubran
Object.toString
on MDN
Learn JavaScript step by step