In PHP, there's this handy construct where you can use the value of a variable as the name of a function, so when you call $foo() you would call the real function bar() or baz(), depending on the value of $foo in the current scope.

Is there an equivalent in JavaScript, and if so, what is it? I am looking at taking the return of an Ajax callback and using it to decide whether to add or remove a classname from an element.


Thanks in advance,

Walter

--
You received this message because you are subscribed to the Google Groups "Prototype 
& script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to