Tell us what’s happening:
Your code so far
let users = {
Alan: {
age: 27,
online: false
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: false
},
Ryan: {
age: 19,
online: true
}
};
function getArrayOfUsers(obj) {
// change code below this line
for( let user in Object.keys(obj)){
return Object.keys( obj[user]);
};
// change code above this line
}
console.log(getArrayOfUsers(users));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
.
Challenge: Generate an Array of All Object Keys with Object.keys()
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object.keys
Hi Guys,
this code isn’t correct for this challenge but i did one teste which iterate also the keys of Object although generate Error for type pass in the second iterate, someone could help ?
thanks.