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

Level9/lesson 7

I am getting the expected output but while submitting I am getting error as "Complete the for loop code". My code is as follows:

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

for(let x in course)
{
console.log(`${x} is ${course[x]}`);
};

I have also tried by removing 'let' in for loop, but, the error is same. Please help me guys.
by

1 Answer

sam5epi0l
Here is the working code:

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

for(x in course)
{
console.log(`${x} is ${course[x]}`);
}

Login / Signup to Answer the Question.