I am new to JavaScript. I have the following code in JavaScript:
function Person(first_name, last_name) {
this.first_name = first_name;
this.last_name = last_name;
this.displayName = function() {
console.log(`Name: ${this.first_name} ${this.last_name}`);
};
}
let john = new Person('John', 'Reid');
john.displayName();
The output of this code is: "Name: John Reid"
I want to understand how this works? What is the role $ is playing in this code? In this part of JavaScript language specification or some other library at work here?
Thanks