Whats are properties and methods used in javascript?

  • 0

Properties are variables used in javascrips.
Methods are functions used in javascrips.

Both are used inside an object.

var myobj={
name : “joe”,  //Property
age  : “20”,   //Property
nameandage: function(){   // Method
console.log(this.name+’with age’+this.age);
}
}

Properties are variables used in javascrips. Methods are functions used in javascrips. Both are used inside an object. var myobj={ name : “joe”,  //Property age  : “20”,   //Property nameandage: function(){   // Method console.log(this.name+’with age’+this.age); } }

Properties are variables used in javascrips. Methods are functions used in javascrips. Both are used inside an object. var myobj={ name : “joe”,  //Property age  : “20”,   //Property nameandage: function(){   // Method console.log(this.name+’with age’+this.age); } }