Tell us what’s happening:
Whenever i try to run the code, i get the error “Cannot read property ‘indexOf’ of undefined”
Do you know why this won’t work?
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
Object.keys(obj);
// change code above this line
}
console.log(getArrayOfUsers(users));
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
.