天天看點

擷取json中的key值

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

js