JavaScript considered dangerous

The JavaScript language is conquering the world right now. Google built a terrific compiler, called the V8 engine, and it is so fast, so good, that all sorts of applications are now being written in JavaScript. But the HTML 5 stack, which consists of 3 different languages, HTML, CSS, and JavaScript is an odd beast, and in the history of computer languages, not a particularly well designed language. It was selected by a staffer at Netscape 20 years ago, and highly similar to ActionScript, Adobe's language that underlies their Flash animation tool.  JavaScript has some really dangerous things it, that really bother a lot of people.  Example 1:

part1 = 10
part2 = 20
part3 = 5
total = part1 + part2 + part3
//total is now 35 as you would expect

part1 = 10
part2 = 20
part3 = "5"
total = part1 + part2 + part3
//total is now "10205"

In the second example, if any component of an expression is a string, then the whole expression is converted to string manipulation, not addition, which could result in baffling program malfunctions. This is an artificial example, but if the variable part3 is coming from some other part of a large program, and it just happens to be set to a string, the rules of the very dynamic JavaScript language mean that total could become a string at any moment. The inability to protect against stupid mistakes makes JavaScript one of most dangerous languages ever invented. When you write JavaScript you have no assurance that your program is correct; you have to test it extensively to verify it is okay, and even after testing, bugs can still remain.
The task of programming is difficult because it requires an inhuman amount of precision. When a language lets you get into trouble easily, it makes the whole process harder and more troublesome. The committee in charge of changing JavaScript knows this, but they can't easily fix it without breaking all the programs that exist. The author of Erlang, the brilliant Joe Armstrong, has noted you only one chance when designing a language to do it right, at the beginning.