获取json中的key值

来源:互联网 发布:php租房管理源码 编辑:程序博客网 时间:2024/05/22 10:27

let inputContent=[{"usertel":"11"},{"userpwd":"22"}];

 for (let i = 0; i < inputContent.length; i++) {

      for (let key in inputContent[i]) {
        console.log('key: ' + key + ' = ' + inputContent[i][key]);
      }

    }

-------------------

key: usertel = 11
key: userpwd = 22

0 1
原创粉丝点击