Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Problem in Level 9 Lesson 7 (Javascript)

let course = {
name: "JS Course",
duration : "15 hours",
price: 499,
discount: "100%"
};

for(key in course)
{
console.log(`${key} is ${course[key]}`);
}
This code is working properly but when I try to submit code it Shows "Complete the for loop code". Please help me with this problem.
by

2 Answers

kshitijrana14
Try this one

let course = {
name: "JS Course",
duration : "15 hours",
price: 499,
discount: "100%"
};

for(x in course)
{
console.log(`${x} is ${course[x]}`);
}
ren-mayday
@kshitijrana14 why keys word is substituted by x?

Login / Signup to Answer the Question.