0 points

typeof Array and Object


dashboard

Wed Oct 14 2020 08:46:59 GMT+0000 (UTC)

Posted by @snigdhakhurana10

//typeof []
console.log(typeof []);

//typeof {}
console.log(typeof {});

//To get actual type
//typeof []
console.log(Object.prototype.toString.call([]));

//typeof {}
console.log(Object.prototype.toString.call({}));
content_copy Copy