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

JavaScript Practice Classes in JavaScript Practicing Classes Practice Instantiating an Object

Sophia Sundance
Sophia Sundance
1,300 Points

Create variable called User? My solution is not working.

My solution is not working, although it is the same as in the official solution. :-(

class User { constructor(email, username, birthday) { this.email = email; this.username = username; this.birthday = birthday; ) } const user1 = new User("JavaScriptStudent@teamtreehouse.com", "JSUser1", "1/08/1991);

User.js
class User {
    constructor(email, username, birthday) {
        this.email = email;
        this.username = username;
        this.birthday = birthday;
 )
}
 const user1 = new User("JavaScriptStudent@teamtreehouse.com", "JSUser1", "1/08/1991");

2 Answers

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi Sophia Sundance,

It looks like your constructor is being closed by a ) instead of }. Changing that bracket on line 6 should fix the error 🙂

Hope this helps.

Sophia Sundance
Sophia Sundance
1,300 Points

Ok, thank you. I did not retype the constructor in the task. Just had to write the "const". Maybe there is an error in the task?

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Not sure what caused that issue Sophia. I deleted the workspace on my end to initialise a new one but the starter code seems to be correct on my end.

Sophia Sundance
Sophia Sundance
1,300 Points

Ok, thank you. I ll try that!