Re:JavaScript problem

Discussion in 'HTML' started by Name_Not_Found, Sep 1, 2005.

  1. Jonathan N. Little wrote:

    > if(arg1 =="" || typeof(arg1)=="undefined")
    > {
    > ................


    if(arg1 =="" || (typeof arg1)=="undefined")


    --
    Name_Not_Found
    Name_Not_Found, Sep 1, 2005
    #1
    1. Advertising

  2. Name_Not_Found

    rf Guest

    Name_Not_Found
    > Jonathan N. Little wrote:
    >
    > > if(arg1 =="" || typeof(arg1)=="undefined")
    > > {
    > > ................

    >
    > if(arg1 =="" || (typeof arg1)=="undefined")


    Heh heh heh...

    Cheers
    Richard.
    rf, Sep 1, 2005
    #2
    1. Advertising

  3. Re: JavaScript problem

    Name_Not_Found wrote:
    > Jonathan N. Little wrote:
    >
    >
    >>if(arg1 =="" || typeof(arg1)=="undefined")
    >>{
    >>................

    >
    >
    > if(arg1 =="" || (typeof arg1)=="undefined")
    >
    >
    > --
    > Name_Not_Found
    >
    >
    >

    Ah no, both are equivalent. The typeof operator can use the optional
    function 'typeof()' format and the order of precedence for above
    operators is

    typeof
    ==
    ||

    so both snippets are functionally the same

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Sep 1, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mcdeveloper
    Replies:
    1
    Views:
    4,189
    mcdeveloper
    Jun 13, 2006
  2. CRON
    Replies:
    24
    Views:
    200,705
    Adrienne Boswell
    Jun 20, 2006
  3. Mark Rae

    JavaScript or not JavaScript

    Mark Rae, Sep 5, 2006, in forum: ASP .Net
    Replies:
    36
    Views:
    1,088
    Paul Sture
    Sep 9, 2006
  4. Nathan Sokalski
    Replies:
    4
    Views:
    577
    PJ on Development
    Nov 8, 2007
  5. Andy
    Replies:
    2
    Views:
    224
    kaeli
    Mar 4, 2004
Loading...

Share This Page