passing javascript method params as object literal [closed]
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 6 years ago . Improve this question I habitually pass parameters to functions as object literals, thus.... calling: render({ param1: 99 param2: {'a': 88, 'b': 77} }); method: render: function (p) { alert( p.param1); var data = p.param2; etc } I tend to pass parameters like this in all