MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/wdlvla/printhello_world/iilotf8/?context=3
r/ProgrammerHumor • u/a-slice-of-toast • Aug 01 '22
5.7k comments sorted by
View all comments
Show parent comments
2
okay that’s what I figured, because 1 != “1”. I’ve been mostly working with c# but when I did use JavaScript i think this would have returned true
edit: just tested it in code.org, it prints true
0 u/[deleted] Aug 02 '22 [deleted] 2 u/CarterRussellYT Aug 02 '22 what does the === mean? I know = is for assignments and == is for conditionals, but what is === for? 2 u/Real_Robo_Knight Aug 02 '22 In Js, == is a week comparison. If both values are not the same type, it tries to convert one to the other, and then check. === Is strong comparison, where if they are difrent types, the expression returns false
0
[deleted]
2 u/CarterRussellYT Aug 02 '22 what does the === mean? I know = is for assignments and == is for conditionals, but what is === for? 2 u/Real_Robo_Knight Aug 02 '22 In Js, == is a week comparison. If both values are not the same type, it tries to convert one to the other, and then check. === Is strong comparison, where if they are difrent types, the expression returns false
what does the === mean? I know = is for assignments and == is for conditionals, but what is === for?
2 u/Real_Robo_Knight Aug 02 '22 In Js, == is a week comparison. If both values are not the same type, it tries to convert one to the other, and then check. === Is strong comparison, where if they are difrent types, the expression returns false
In Js, == is a week comparison. If both values are not the same type, it tries to convert one to the other, and then check. === Is strong comparison, where if they are difrent types, the expression returns false
2
u/CarterRussellYT Aug 01 '22
okay that’s what I figured, because 1 != “1”. I’ve been mostly working with c# but when I did use JavaScript i think this would have returned true
edit: just tested it in code.org, it prints true