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 trialTiger Wang
26,548 PointsThe Quiz question is holding a wrong answer.
In question 'Which of the following functions correctly implements default parameters?', I think the answer is obviously "function myFunction(name = 'Ken')". But I'd tried for several times, it always said I was wrong. Could you please check the setting of the Quiz?
2 Answers
Ken Howard
Treehouse Guest TeacherThank you for point this out! The correct answer (per the quiz) is using invalid syntax. We'll get it fixed.
The correct syntax should be:
function myFunction(name = 'Ken') { … }
Tiger Wang
26,548 PointsWell, I made a mistake, the answer is "function myFunction(let name = 'Ken') { … } ", Another question is, when I add it to my project , the error comes like
function myFunc(let name = 'Tiger'){
^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
Tiger Wang
26,548 PointsTiger Wang
26,548 PointsThank you for your timely response, Ken.