• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compare two javascript strings  RSS feed

 
Dumidu Udayanga
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66264
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a question?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37403
531
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are asking about the syntax for comparing two strings for equality, see this article
 
Nag Kakolla
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the answer,


We can use '==' for equal comparision, != for not equal and '====' for strict equal comparision and !== for strict not equal.

strict means in javascript, checking for value and type.
1==='1' are not equal as even though value 1 and '1' are equal but different type number & string.
so 1==='1' will give false.



ask any specific question you have so i can address it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!