Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


Comparing Strings in JavaScript

comparing strings javascript

  • Please log in to reply
 

#1 Salwa

Salwa

    Senior Member

  • Designer
  • 181 posts

Posted 18 July 2013 - 09:24 PM

To compare strings in JavaScript
1 .First make sure that the strings you are comparing are not null.
2.you can check if the strings are null by doing this
if (stringA == 'null')
This will return true if stringA is null.
Or you can do
if (stringA != 'null' && stringB != 'null')
3.Now that you made sure the strings are not null compare them like this
if (stringA == stringB) {}
  • lalelemu likes this





Also tagged with one or more of these keywords: comparing strings, javascript

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users