Prototype used in Node.js
Component Name: prototype.js
--------------------------------------------------------------------------------
//Prototype ka use function me value ad karne ke liye kiya jata hai
function student(){
this.name="Abhishek";
this.age=29;
this.email="abhishekpratapsingh@gmail.com"
}
student.prototype={
address:"Banglore",
getAddress:function(){
return this.address;
}
}
var stu = new student();
console.log(stu.address);
Comments
Post a Comment