javascript anonymous autoexec with parameter -
i creating javascript object anonymous function this
(function(){ window['d'] = this; this.sayhello = function(){ console.log("hello world"); } })();
how pass parameter d
object can call d(someparams).sayhello()
can call d.sayhello()
. need change , where?
(function(){ var pars = arguments[0] || {}; window['d'] = this; this.sayhello = function(){ console.log("hello world"); } })({a:'test'})
Comments
Post a Comment