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 trialhazell
Front End Web Development Techdegree Graduate 14,406 Points"Inside the stringGPA() method, convert the value of the gpa property to a string and return it."
What am I doing wrong?
class Student {
constructor(gpa){
this.gpa = gpa;
}
stringGPA(){
return this.gpa.toString;
}
}
const student = new Student(3.9);
1 Answer
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsHi Hazell!
You're so close! .toString()
is a method so we need to add the parenthesis after it. All you have to do is add the ()
to the end of .toString
and you're good to go.
Hope this helps!
hazell
Front End Web Development Techdegree Graduate 14,406 Pointshazell
Front End Web Development Techdegree Graduate 14,406 PointsGreat, thanks so much for your help :)
Bella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsBella Bradbury
Front End Web Development Techdegree Graduate 32,790 PointsOf course! If you're satisfied with my answer you can go ahead and click "best answer" to close out this discussion. It's just a way of letting others know that this question is resolved, this discussion will still be available!