6 AnswersNew Answer
Noise Of Silence I repeat my las answer with example: str1 = "String" str2 = "String" str1 == str2 => true (because they aren't "objects") str1 = new String ("String") str2 = new String ("String") str1 == str2 => false (because they are "objects" now)
Qasem is very correct. And I particularly like the human-money illustration. In addition I will say try studying 'Pass by reference.' Nice question by the way 👍🏽
Qasem NuminousC (o() is console.log function) var bool1 = true; var bool2 = true; o(bool1 == bool2); o(bool1 === bool2); var str1 = "String"; var str2 = "String"; o(str1 == str2); o(str1 === str2); Still false ?
Noise Of Silence pay attention to "object" term. If you define str1 and str2 as string objects (with new keyword) then they won't be equal.
Qasem all four outputs are true. Both for Boolean and string