+ 1
What is the best practice to create JavaScript object?
var a={};a.calc=function(){}; var a={calc: function(){}}; among the above two ways which one is best way to create object.
1 Answer
+ 9
first one allows more control
var a={};a.calc=function(){}; var a={calc: function(){}}; among the above two ways which one is best way to create object.