0

What does this.objectname do in objects javascript. for example you write function person(name, age){this.name= name; this.age=}

Please help! for example you write function person(name, age){this.name= name; this.age=}

14th May 2021, 2:06 PM
Mohammad M
Mohammad M - avatar
1 Answer
+ 4
this keyword is use for giving values to the object properties which we created like suppose you make an object of Car, so this.name = "xyz" means that we giving the car object we created a name of "xyz". https://www.sololearn.com/discuss/1084213/?ref=app https://www.sololearn.com/discuss/456845/?ref=app https://www.sololearn.com/discuss/190653/?ref=app
14th May 2021, 2:09 PM
minirkk
minirkk - avatar