js 获取 对象 属性名称(转载)

来源:https://www.cnblogs.com/YuyuanNo1/p/9257634.html

dataObj = {
name : su,
age : 26,
height : 18cm
};
for(var st in dataObj) {
console.dir(st);
}


/////////////打印
name
age
height
posted @ 2019-10-06 16:44  hao_1234_1234  阅读(7932)  评论(0编辑  收藏  举报