JavaScript - some negative sidescover image

JavaScript - some negative sides

Tim Bernhard

JavaScript

This post is old. Codes, opinions and facts could be outdated.

Help to fix potential errors: GitHub

I am by far not the only one having written on this topic, nor did I do any good. More entertaining examples can for example be found in the following video: [https://www.youtube.com/watch?v=2pL28CcEijU[(https://www.youtube.com/watch?v=2pL28CcEijU).

Have you ever tried to compare 1 + 2 with 3 in JavaScript? Or assign an undefined value? Now try it. Are the results satisfactory?

JavaScript is a very controversial programming language. Although it offers approaches to an object-oriented programming language, it is ultimately only prototype-based.

The problem with JavaScript is probably the many cooks who spoil the broth to put it metaphorically.

In the following I don't want to base JavaScript or anything - you can form your own opinion. However, I would like to give you some more examples of what I think are abnormal possibilities.

  • Add up "4" and 4.

  • Subtract 4 from "4".

  • Compare parseInt ("06") with parseInt ("09")

  • Check 0 == "", false == "0", and variations

I hope you enjoy it - if you can think of other examples that you think should be included in this list, please write them in the comments!

Webmentions

No webmentions found for this page.