- <script type="text/javascript">
-
- var myObject = {'name':'Kasun', 'address':'columbo','age': '29'}
-
- var count = Object.keys(myObject).length;
- console.log(count);
- </script>
Object.keys().length 就可以了
标签:count,myObject,keys,Object,个数,length,JS,JSON,var
来源: https://www.cnblogs.com/panwudi/p/15726786.html