From: Dr J R Stockton on 18 May 2010 11:57 In comp.lang.javascript message <j9mdnbPrgdqQ4mzWnZ2dnUVZ8jKdnZ2d(a)gigane ws.com>, Mon, 17 May 2010 19:38:21, Stefan Weiss <krewecherl(a)gmail.com> posted: >On 13/05/10 18:00, Dr J R Stockton wrote: >> In comp.lang.javascript message <5dmdnU-R8ZcDbHTWnZ2dnUVZ8ludnZ2d(a)gigane >> ws.com>, Wed, 12 May 2010 02:09:01, Stefan Weiss <krewecherl(a)gmail.com> >> posted: >> >>>On 11/05/10 19:34, Dr J R Stockton wrote: >>>> In comp.lang.javascript message <ab37b500-1b97-450c-9498-badd643ac361(a)j3 >>>> 5g2000yqm.googlegroups.com>, Sun, 9 May 2010 20:02:32, nick >>>> <nick___(a)fastmail.fm> posted: >>>>>What's the "best" way to determine if a variable is defined? >>>> >>>> I don't recall any problem in testing X for the value undefined by using >>>> >>>> var U >>>> // ... >>>> if (X==U) ... >>>> >>>> although one must remember not to define U. >>> >>>... and to use the strict comparison operator. >> >> Is that needed if X cannot be null ? > >No, but that wasn't mentioned anywhere by the OP. Perhaps he did not think of it : the sort of people who actually use 'null' tend not to ask questions here. I was wanting to verify my opinion, obtained from the definitive but complex ECMA 262, that. since I only have actually used it to handle argument lists with genuinely undefined arguments, I have nothing that needs fixing. -- (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; WinXP. Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links. PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm> My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.
First
|
Prev
|
Pages: 1 2 3 4 5 6 Prev: _google_spam_shame_ online casino ... Next: Firefox Error Console links |