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

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -