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 trialTimothy Tuite
5,429 Pointsuncaught syntax error unexpected token and grade function not defined
Im try to create a simple calculator application for a webpage with java script. I am receiving two errors one is an unexpected token function gradefunction(a,b,c,d,e){ setValues(); result = (((a*b)-(c+e))/(b-d))*100); error on this line }
and the other is in the button line <button id="calculate" type="button" onclick="gradefunction()">Calculate</button><br>
1 Answer
pi R
12,720 PointsI think your problem with " unexpected token " is the ")" after *100 ( you have 5 opens and 6 closings). If you delete it, the function will be properly defined and the code can run :)