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

Javascript Level 9 Lesson 7

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

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

code runs but can't able to submit.
by

1 Answer

iamabhishek
Please do not change the given sample code, correct code for for loop will be:

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

Login / Signup to Answer the Question.