IF Statement Simple Help!!

Discussion in 'JavaScript' started by wd_2k6, Apr 27, 2008.

  1. #1
    Hi Simple Question:

    How do i add an argument to my If Statement, for example I have:

    if (blah == null)

    But How do I say

    if (blah==null or if blah > 10 )

    I know && is if both arguments are true, but one or the other could be true!! Would the word "or" work or do i use a comma or what?!?!?!?!?
     
    wd_2k6, Apr 27, 2008 IP
  2. MCJim

    MCJim Peon

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm not sure about Javascript but in most languages it is ||, try that out.
    if (blah==null || blah > 10 )
     
    MCJim, Apr 27, 2008 IP
    wd_2k6 likes this.
  3. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Many Thanks it seems to be working for now!! I'm using Java not Javascript but it's all the same afaik!!
     
    wd_2k6, Apr 27, 2008 IP