快速获取js对象键和值

var o = {

“say”: “Hello World”,

“name”: “Keith Chou”,

“height”: “180”,

“weight”: “120”

};

Object.keys(o);

// [“say”,”name”,”height”,”weight”]

Object.values(o)

//[“Hello World”, “Keith Chou”, “180”, “120”]

    原文作者:iteye_11116
    原文地址: https://blog.csdn.net/iteye_11116/article/details/82680266
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞