30 AnswersNew Answer
'==' is used for comparison between two variables irrespective of the datatype of variable. '===' is used for comparision between two variables but this will check strict type, which means it will check datatype and compare two values.
== equal to comparison === Identical(equal and of the same type)
== this check only value but === this check value and data type. Ex 2===2 same value and same data type but 2=="2" same value but not same data type.
"1" == 1 is true. But "1" === 1 is false.
Please use search bar before, to avoid dublicates... Hope these helps you.. Thank you.. https://www.sololearn.com/discuss/1922428/?ref=app https://www.sololearn.com/discuss/364595/?ref=app https://www.sololearn.com/discuss/1213035/?ref=app https://www.sololearn.com/discuss/542577/?ref=app https://www.sololearn.com/discuss/468107/?ref=app https://www.sololearn.com/discuss/602535/?ref=app https://www.sololearn.com/discuss/1419547/?ref=app
== is used for comparison between two variables irrespective of the datatype of variable. === is used for comparision between two variables but this will check strict type, which means it will check datatype and compare two values.
== is used to conpare two values === is used to compare two values and their type
== only compares the values but === compares values and types For example: $a = 1; $b = "1"; $a == $b ; returns TRUE because the both have the same value that is 1 $a === $b; returns FALSE because the value of $b wrote in double quotation " " and it's defined as string type while the $a value has not quotation and defined as integer So and integer is not same as string type and it returns false
If the comparison is between the same value type both == and === do exactly the same thing. If the value types being compared are different the == differs from === in that it allows type conversion before the comparison.By default the non-number values ("5",true,false) to be converted to numbers (5,1,0) before the comparisons are made. For more details see https://github.com/Li-YangZhong/You-Dont-Know-JS/blob/2nd-ed/get-started/ch2.md here
== compares only the value. === compares value and type. e.g. 5 == "5" is true. 5 === "5" is not true.
== checks two variables same or not, it doesn't check the data type. === checks two variables same or not and the data type must have to be same. "1" == 1 it will return true. Here the 1st 1 is string and the 2nd 1 is integer. It is true because the values are same. "1" === 1 it will return false. Though the values are same but the data types doesn't match.
'==' denote equal to For example : 10==10; its true And '===' its identically equal to and same For example 10===10
Jitendra Kumar No need to be sorry. Don't say that.. Its just information and a request giving to you.. Because dublicates may gets deleted by mods to keep search bar, & SL clean.. So information only..
== only checks the content if they match. Like string "1" & integer 1. It will return true because content is same though data types are not same. But === also checks if they are of same data type,which in above case is not true, as "1" is string & 1 is number. So that will return false now.
double equal is for compare '5' == 5 --> true three equal is identical '5' === 5 --> false Show '5' is a string, but 5 is int.