Why JavaScript is a bad programming language

Designed in 10 days

Normal programming languages took years to design, but JavaScript was only designed in 10 days before being released into the wild with all its bugs and imperfections.

Insane operations

So many operations in JavaScript produce wildly unexpected results.

true + true == 2 → true
true == '1' → true
false == '0' → true
false == 0 → true

0 == '0' → true
'\t' == 0 → true
[] == 0 → true
'\t' == [] → false

'\t' == '0' → false
'\t' == false → true

[]+{} → "[object Object]"
{}+[] → 0
![] → false
+!+[] → 1
[+!+[]]+[+[]]+[] → "10"

9999999999999999 == 10000000000000000 → true

Confusing name

JavaScript has nothing to do with Java. The name implies that JavaScript is related to Java, but it's really a whole different language.

JavaScript was developed at Netscape and was originally named LiveScript, but they thought it should be more confusing for some reason.


See also