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 trialRowan Blackwood
5,220 PointsUnexpected string...
So I have been through just about every question and answer and I feel like my implementation should be correct, but I'm guessing I'm missing something here. Anyone got any ideas? The error I get is 'Bummer: Unexpected string'
Thanks
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) {
retun 'Junior';
} else if (this.credits <= 60 && this.credits >= 31) {
return 'Sophomore';
} else if (this.credits <= 30) {
return 'Freshman';
}
}
}
const student = new Student(3.9, 50);
3 Answers
Nick Evershed
6,429 PointsIt would probably be much more helpful if you could actually see the output of your code, try use this resource https://repl.it/repls/EssentialSelfreliantLock
Nick Evershed
6,429 PointsNo worries! if you found it useful, please mark as 'Best Answer'
Rowan Blackwood
5,220 PointsWorth it just for the repl.it tip ;) Thanks again
Nick Evershed
6,429 PointsIts funny because another user on treehouse actually helped me by suggesting this resource, i'm just passing the resource along now
Rowan Blackwood
5,220 PointsRowan Blackwood
5,220 Pointshahaha :facepalm: school boy error. It's always the typo's that cause the biggest headaches! The funniest bit is it's even highlighted in the editor. What a donut. Thanks for your help!