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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -