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 User Authentication With Express and Mongo User Registration Defining a Mongo Schema with Mongoose

Quick question

Hi guys

I was wondering if there was any particular reason Dave set the two variables to User and UserSchema rather than starting them both with lowercase?

Thanks in advance Happy coding Paul

1 Answer

It is usually good/common practice to have your "classes" start with uppercase. To Later use the User model you will need to create a user object. You do that by

const user = new User({});

Having it be uppercase you will know that it will be used to create new objects

Think i understand, there is so much still to learn about JavaScript.

Thanks a lot

Paul