Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Object-Oriented JavaScript Working with Classes in JavaScript Adding methods to classes

Still no pass! Anybody know why?

How to convert gpa to string and return it.

adding_methods.js
class Student {
    constructor(gpa){
        this.gpa = gpa;
    }
    stringGPA(gpa) 
  {
    const stringgpa = String.valueOf(gpa);
    return stringgpa;
  }
}

const student = new Student(3.9);

2 Answers

Tim Knight
Tim Knight
28,863 Points

Hi Fabian,

You might want to check out the thread from your previous comment at https://teamtreehouse.com/community/how-do-i-convert-the-gpa-value-to-string-anybody. I just tried the suggestions from that thread and it passed without any issues.

Hi, Tim You were right the this.gpa.toString(); was indeed right and sometimes workspaces experiences some hickups i have noted. Wether this is do to memory issues? But your answer is the best. Thanks