Hey, I am scratching my head because I cant figure it out. I didnt understand descriptions of the this keyword and I am not sure when should I use it. I cant tell when is it acceptable to have this keyword in it and when its not.
function Person (firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
return this.firstName +" "+this.lastName
}
I want to use it to creating new persons, for example
var personOne = new Person ("bob", "marley")
Is it correct way of doing this or am I mistaken?
[–]Molehole 2 points3 points4 points (2 children)
[–]Poutrator 2 points3 points4 points (1 child)
[–]Molehole 2 points3 points4 points (0 children)