Anonymous self-invoking JavaScript function - returning multiple objects?

I'm not sure what the goal of al this is, but maybe you could return both functions in an object, like so: var funcs = (function() { var x = function() { alert('tadaaa'); return 1; }; var y = function() { alert('tadaaa'); return 1; }; return {x: x, y: y}; })(); funcs.x(); funcs.y() This is basically what the Module Pattern is about (see for example adequatelygood.com/2010/3/JavaScript-Mod... ) It's good! Depending on what you need, of course.

I'm not sure what the goal of al this is, but maybe you could return both functions in an object, like so: var funcs = (function() { var x = function() { alert('tadaaa'); return 1; }; var y = function() { alert('tadaaa'); return 1; }; return {x: x, y: y}; })(); funcs.x(); funcs.y(); This is basically what the Module Pattern is about (see for example adequatelygood.com/2010/3/JavaScript-Mod...). It's good! Depending on what you need, of course.

You can: var x, y; (function() { x = function() { alert('tadaaa'); return 1; } y = function() { alert('tadaaa'); return 1; } })().

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions