+ 2

In JavaScript, what is the difference between a method and a property?

24th Jun 2018, 6:31 PM
Nick
Nick - avatar
3 odpowiedzi
+ 8
var obj={ x:5, dance:function(){} } properties are always strings,objects or numbers.. methods are functions
24th Jun 2018, 6:52 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 3
Also note that Methods and Properties are general programming concepts and not specific to Javascript or different in Javascript.
25th Jun 2018, 11:26 PM
Duncan
Duncan - avatar