In comp.lang.javascript message <48b572c9$0$12953$9b4e6d93@newsspool2.ar
cor-online.net>, Wed, 27 Aug 2008 17:29:13, Martin Honnen
<mahotrash@yahoo.deposted:
Quote:
>sheldonlg wrote:
>
Quote:
>You mean simply leave off the quotes in the initial call is all I
>>have to do?
>
>Yes, you can do that to pass the function as an argument to the other
>function.
For those who really do want to pass in the name of the function as a
string (as originally asked), the notation shown by
window["LZ"](5)
is available; for me, that returns '05'. No doubt someone will comment
if that method is not always available.
If the function is frequently needed, consider :
Fn = window["LZ"]
Fn(5) + Fn(6) // gives '0506'
If, having received a function itself, one wants the name. one can
generally get it by a RegExp match on Fn.toString() ; js-nclds.htm .
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF2 Op9 Sf3
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.