Adding the users class

First, we're going to get started adding the users class and then. We'll finish it up adding all the methods. For now though, we can start defining the class, I am going to comment out the Person class we just added, since we do want it in place as documentation. But we're not going to exactly use it inside the app. We'll delete it a bit later once we are more comfortable with classes.

Now, we're going to start by creating our users class using the class keyword, class Users. We're then going to go ahead and open up and close our curly braces, and inside here we can specify any methods we like, such as the constructor function. We are going to define a constructor function, although they are completely optional when ...

Get Advanced Node.js Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.