📌  相关文章
📜  在 javascript 代码示例中正确键入检查对象

📅  最后修改于: 2022-03-11 15:01:16.695000             🧑  作者: Mango

代码示例1
// Correctly type checking objects in Javascript
const Drinks = {
 Name:'Lemonde',
 ID: '#0000#✏#',
 Sale :{
   price:99,
   Full:100
 }

}

console.log(Object.prototype.toString.call(Drinks)); // Result = [object object]


// Note you can also use this method to type check Arry too.