What are the main critiques of javascript? Genuinely curious, would like to hear from people that use or used it to build real projects.
It was frustrating enough to turn me off using languages that don't have compile time type checking.
If you pass fewer arguments than declared parameters, the rest are implicitly undefined. The variations you were seeing probably just came down to how the invoked function handled that undefined value. I can still understand how inconsistency in behavior there might be confusing.
As far as JavaScript the language goes, my biggest complaints are to do with the sparse standard library (leftpad should be something easy to do with built-in string formatting functions[0], not a 3rd-party library), unexpected behaviour (the map/parseInt thing[1] being one example), etc.
The unexpected behaviour stuff is truly a case of needing to understand the language - after all, why should JavaScript behave like Python? However, as someone who doesn't use JS much, these bits of weirdness make it more difficult to use when I need to.
[0] https://docs.python.org/2/library/stdtypes.html#str.rjust - this is a Python example, but why doesn't JS have this in its stdlib?
> 'foo'.padStart(20)
< " foo"
The fact that Array.prototype.map has different semantics from Python's map built-in, as most likely encountered by newcomers to JavaScript with the [...].map(parseInt) issue, is something that bit me once, maybe twice, before I adjusted to it - especially given that I'm more likely to use comprehensions than map in Python nowadays anyway. And the fact that the callback receives the index in JS is useful in far more situations than it causes problems, and it's certainly nicer than >>> [ callback(v, i) for (i, v) in enumerate(arr) ]
when you want the index position.