Web Analytics Made Easy -
StatCounter If Not Statement - CodingForum

Announcement

Collapse
No announcement yet.

If Not Statement

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • If Not Statement

    In PHP it's possible to use an exclamation mark to make an if statement mean if not.

    Can you do this with javascript?

    For instance can I use one on the code below to ask if not greater than or equal to?

    Code:
    if(user.length >= 4) 
    {
    Last edited by stevenmw; Sep 5, 2011, 07:11 PM.
    Thanks!

  • #2
    looks pretty similar to me
    W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

    Comment


    • #3
      No, I need the > =4. I want the if statement to be the opposite.

      I want to say if not >= 4 do this, else if, if

      But I don't know how to switch the if statement to ask for the opposite. I know in PHP. If use a '! '
      Thanks!

      Comment


      • #4
        Resolved. Thanks.
        Thanks!

        Comment


        • #5
          yeah, sometimes you have to scroll down.

          although - and it's quite possible that my math is bad here - it seems to me that

          if (!(x>=4)){

          is just a more complicated way of saying

          if (x<4){

          ...

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎