Unlike PHP wherein you will first define a class and to create a new object, and you will then instantiate an instance of that particular class. But in javascript what causes confusion at first is that any function can also be instantiated as an object.
How it works:
function User(name){
this.name = name;
}
var Me = new User("James");
alert(Me.name) //return "James"
var You = new User("Visitor");
alert(You.name) //return "Visitor"
This is only the beginning of understanding how javascript works and it’s difference from other languages. The language of Nodejs.