Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

difference between single quotes and double quotes in javascript

/*
== in JavaScript is used for comparing two variables.
=== is used for comparing two variables, 
but this operator also checks datatype and compares two values
*/

0 == false   // true
0 === false  // false, because they are of a different type
1 == "1"     // true, automatic type conversion for value only
1 === "1"    // false, because they are of a different type
null == undefined // true
null === undefined // false
'0' == false // true
'0' === false // false
 
PREVIOUS NEXT
Tagged: #difference #single #quotes #double #quotes #javascript
ADD COMMENT
Topic
Name
5+3 =