I tried JS multiple times. And every time, easy things are complicated when doing them in JS.  It is much easier and faster for me to do those same things in C, even though I&#x27;m equally familiar with both. This is mostly because there are just so many gotchas.<p>Here are some examples from this week:<p>Checking whether a passed argument is an array or a dict:<p><pre><code>    var a = []
    if (Object.prototype.toString.call(a) !== &#x27;[object Array]&#x27;) ...
</code></pre>
(perhaps not js itself, but how it is used) Leaking DOM nodes are a thing:
<a href="https:&#x2F;&#x2F;developer.chrome.com&#x2F;devtools&#x2F;docs&#x2F;heap-profiling-dom-leaks" rel="nofollow">https:&#x2F;&#x2F;developer.chrome.com&#x2F;devtools&#x2F;docs&#x2F;heap-profiling-do...</a><p>Easy things like getting values of a dictionary:<p><pre><code>    var d = {
        a: [1,2,3,],
        b:[4,5]
    }
    var values = Object.keys(d).map(function(key){
        return d[key];</code></pre>
});<p>in Python, it&#x27;s just .values()<p>Errors aren&#x27;t thrown when there are obvious issues with the code.<p>String.replace replaces one instance instead of all instances in a string.<p>Functions arguments are a bit of a mess.<p>differences between<p><pre><code>    for each (var myVar in myObject)
    for (var myVar in myObject)

</code></pre>
random things like these:<p><a href="http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;2568966&#x2F;how-do-i-pass-the-value-not-the-reference-of-a-js-variable-to-a-function" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;2568966&#x2F;how-do-i-pass-the...</a><p>All the things here:<p><a href="http:&#x2F;&#x2F;www.toptal.com&#x2F;javascript&#x2F;10-most-common-javascript-mistakes" rel="nofollow">http:&#x2F;&#x2F;www.toptal.com&#x2F;javascript&#x2F;10-most-common-javascript-m...</a><p>If you import a library, they could have modified the global scope. This is common in JS libraries. Then some things you wrote don&#x27;t work.<p>undefined&#x2F;null thing<p>differences between var declared function and regular named function.<p>Many things in the language are not obvious and you have to discover them through trial and error or study JS internals and find out how things are implemented.