Why this code (my code) is incorrect?
Your code so far
let users = {
Alan: {
age: 27,
online: true
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: true
},
Ryan: {
age: 19,
online: true
}
};
function isEveryoneHere(obj) {
// Only change code below this line
if('Alan' in obj && 'Jeff' in obj && 'Sarah' in obj &&'Rayan' in obj)
{ return true;
}
else{ return false;}
// Only change code above this line
}
console.log(isEveryoneHere(users));
Your browser information:
Challenge: Check if an Object has a Property
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).
padunk
January 20, 2021, 2:51am
3
Hi,
You have a typo Ryan Not Rayan.
1 Like
Edit: haha typed to slow. you already got it
This is not how you spell ryan
mariannegreas:
obj &&'Rayan'
Thank you!! Next time I will do. This is my first time to post a question.
1 Like
system
Closed
July 21, 2021, 2:54pm
7
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.