let outputMembers = (jsonPlayers) => {
let keys = [];
for(let parse in jsonPlayers) {
keys.push(parse); //Получаю ключи
}
for(let i=0; i = keys.length; i++) {
let key = keys[i];
console.log(jsonPlayers.key) // Подставляю ключи, выводит undefined.
}};
console.log(eval(jsonPlayers));
const jsonPlayers = {
"name": "John",
"age": 30,
"isAdmin": false,
"courses": ["html", "css", "js"],
"wife": null
};
const outputMembers = (jsonPlayers) => {
let keys = [];
for(let parse in jsonPlayers) {
console.log(parse, jsonPlayers[parse])
}
};
outputMembers(jsonPlayers);
const jsonPlayers = { key: 'foobar' }