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

Melissa Preece
Melissa Preece
Full Stack JavaScript Techdegree Student 7,456 Points

Help! code challenge in Object-Oriented JavaScript course

Hi all, I am stuck on task 2 of this challenge. Not quite sure how to convert a numeric value into a string. I looked online and possibly found a solution using ' ' + gpa, but that doesn't seem to work. Can someone help please? Here's the link:

class Student {
        this.gpa = gpa;
    stringGPA(gpa) {
        this.gpa = '' + gpa;
        return gpa;

const student = new Student(3.9);

1 Answer