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 trialWendy Anderson-Burton
948 Pointserror does not make sense
THIS IS THE CODE const name = "Andrew"; const details = { favouriteLanguage: "JavaScript", age: 33, children: 3 } const errorMessage = "Something bad has occurred"; console.log(name); console.dir(details); I needed to console the error message THIS IS WHAT I TYPED AFTER THE last line. console.err(errorMessage); Why is this wrong?
const name = "Andrew";
const details = { favouriteLanguage: "JavaScript", age: 33, children: 3 }
const errorMessage = "Something bad has occurred";
console.log(name);
console.dir(details);
console.err(errorMessage);
4 Answers
Jennifer Nordell
Treehouse TeacherHi there! I received your request for assistance. When you try and run this code in the challenge you will receive a "console err is not a function". This is because err
is not a valid console function. However, error
is. If I change your last line to:
console.error(errorMessage);
Your code passes! Here is the MDN documentation that shows all valid functions on the Console
object.
Hope this helps!
af09
10,704 PointsTry this:
console.error(errorMessage);
Adam Beer
11,314 PointsHi! Just a typo. console.err is not a function. Please change to console.error.
Wendy Anderson-Burton
948 PointsThank you all I will go back and try that.