Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Carolyn Keller
seal-mask
.a{fill-rule:evenodd;}techdegree
Carolyn Keller
Front End Web Development Techdegree Student 7,572 Points

task 2 of 2 section code challenge Loop Through an Object's Properties. Saying my answer is wrong

I am answering :

for(let property in composer) {
console.log('${property}: ${compose[property]}');
}

and I keep getting that is the wrong answer. Can anyone help to let me know what I am doing wrong?

1 Answer

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi Carolyn Keller 👋

You're super close here but there are two things you'll want to have a look at. First off the object is called composer while in the loop you're trying to access a compose object (missing r).

You'll also want to make sure to use backticks instead of regular quotation marks 🙂

for(let property in composer) {
  console.log(`${property}: ${composer[property]}`);
}

After those small adjustments your code should pass the challenge as expected 🎉