获取对象的程度,可以这样获取:
var myObj = {a:1,b:2,c:3}
var arr = Object.keys(myObj);var len = arr.length
console.log(len)//3
原文地址:https://www.cnblogs.com/chaoyong/p/8718163.html
时间: 2024-11-06 09:52:16
获取对象的程度,可以这样获取:
var myObj = {a:1,b:2,c:3}
var arr = Object.keys(myObj);var len = arr.length
console.log(len)//3
原文地址:https://www.cnblogs.com/chaoyong/p/8718163.html