Methods can be any function, they could take arguments, maybe they won't take arguments, and to define them all we do is the following. Without adding a comma, another quirk of the class syntax, we specify our method name. I'm going to create one called getUserDescription:
getUserDescription () {
}
This one is not going to take any arguments so we can leave that arguments list empty. Inside the function itself, we're going to go ahead and return a description, since the method after all is called getUserDescription. We're going to return a template string injecting some values inside there, the general flow is going to be Jen is 1 year(s) old:
getUserDescription () {
return `Jen is 1 year(s) old`;
}
This is what we want to print, but we want to use those specific values for this individual person, and to do that we're going to access those properties once again. Instead a static name, we're going to inject this.name; and instead of a static age, we're going to inject the age, this.age:
getUserDescription () {
return `${this.name} is ${this.age} year(s) old`;
}
Now we can go ahead and actually test out getUserDescription by calling it down below. We can make a variable called description, set it equal to me.getUserDescription, and can go ahead and do something with the return value, like print it to the screen using console.log. Inside the log argument list, I'm just going to pass in description:
class Person {
constructor (name, age){
this.name = name;
this.age = age;
}
getUserDescription() {
return `${this.name} is ${this.age} year(s) old`;
}
}
var me = new Person('Andrew', 25);
var description = me.getUserDescription();
console.log(description);
Now we can save the file and we should see over inside the Terminal our description; in this case, Andrew and 25, Andrew is 25 years old. When I save the file nodemon is going to restart, and right here we get just that Andrew is 25 year(s) old printed to the screen:

This is the very basics of classes, there's a ton of class-related features we won't be exploring just yet, but for now this gives us everything we need in order to get started. Instead of a Person class, we're going to create a users class, and instead of methods like getUserDescription, we're going to create the custom methods. We're also going to be adding test cases as we go to make sure they work as expected.