Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to compare two strings in javascript if condition

var string1 = "Hello World";
var string2 = "Hello world.";
if (string1 === string2) {
  console.log("Matching strings!");
}
else {
  console.log("Strings do not match");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compare #strings #javascript #condition
ADD COMMENT
Topic
Name
9+7 =