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 trial
Jesse Page
Courses Plus Student 18,465 PointsThis is working through my external editor and it's logging out correctly, but within the code challenge, it's not.
Why is it producing an "Your conditional statement is returning the wrong student level." error when it's logging out correctly within my external editor (2 lines at bottom used to test):
class Student {
constructor(gpa, credits) {
this.gpa = gpa;
this.credits = credits;
}
stringGPA() {
return this.gpa.toString();
}
get level() {
if (this.credits > 90) {
return 'Senior';
} else if (this.credits <= 90 && this.credits >= 61) {
return 'Junior';
} else if (this.credits <= 60 && this.credits >= 31) {
return 'Sophmore';
} else if (this.credits <= 30) {
return 'Freshman';
}
}
}
const student = new Student(3.9, 91);
console.log(student);
console.log(student.level);
Moderator edited: Markdown added so that code renders properly in the forums. -jn
1 Answer
Jennifer Nordell
Treehouse TeacherHi there, Jesse Page! First, you're doing terrific! You are off here by a single character. While the word "Sophomore" is often pronounced in English (at least the American dialect) as "Sophmore", it does contain one extra "o" that is not generally pronounced. Your problem here is in your spelling of "Sophmore" vs the correct spelling of "Sophomore".
Hope this helps!
Jesse Page
Courses Plus Student 18,465 PointsJesse Page
Courses Plus Student 18,465 PointsOh my. Just a complete misfire. Thanks so much!