SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    String comparison value issues

    Hi there,


    Ive been watching a tutorial video off lynda.com and in the one video she uses:

    if ("55" < "100")

    and this equates to false - How does this evaluate to false and on what principle ?

    the other example is :

    if ("10" < "100")

    and this equates to true, again I cannot work out why

    Ive tried numerous attempts to try and work this out, but Ive not been very successful, any help or a kick up the ar*e in the right direction will be greatly appreciated.

    Ben

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2010
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's really weird...

    Likewise, this equate to true: if("the" > "cow"){ ...

    and this equates to false: if("cow" > "the"){ ...

    how odd

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But if you try

    if("cow" > "bee") evaluates to true

    But

    if("cow" > "dog" evaluates to false


    More help kind people :-)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •