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 trialAmy Preci
6,247 PointsDid anyone else get an error when adding .toFixed(2)?
Adding .toFixed(2) to the end of the reduce method gave an error: "filter and reduce methods have not been called yet." Why did it work for him in the video but not here when the two problems are almost the same?
1 Answer
Steven Parker
231,172 PointsThe challenge is expecting the result as a number, but toFixed converts the number into a string.
This was not an issue in the video, since no numeric evaluation was being performed and the the result was just being displayed on the console.
Cas F
Full Stack JavaScript Techdegree Student 21,170 PointsThis fixed the problem for me. Just remove the "toFixed" from your method chain and the challenge accepts your solution.
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsBella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsPlease post your code so that we can see whatβs happening and then help to troubleshoot! In the future, when posting via the "get help" button from a challenge, please make sure "Attach my code with this post" is checked.