3 ms·
Playing around a bit with tio.run-- Javascript: console.log("1"==1) True Perl: print "1"==1; 1 What's your preferred language?
by blacksqr 9y ago
Playing around a bit with tio.run--
Javascript:
console.log("1"==1)
True
Perl:
print "1"==1;
1
What's your preferred language?
- blacksqr 9y agoPHP: <?php echo "1"==1; ?> 1
- ytch 9y agoMost of my work use Python right now Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> "1"==1 False I don't even notice so many script language has "1"==1, that's interesting. I also find that in Javascript: >>typeof(1) "number" >>typeof("1") "string" PHP: >>> gettype("1") => "string" >>> gettype(1) => "integer" Can distinguish this two type, but AFAIK, I can't do this in Tcl?
- mypalmike 9y agoA major reason Java programs are generally quite robust IMO... System.out.println(1 == "1"); error: incomparable types: int and String