Hacker News new | ask | show | jobs
by umpalumpaaa 628 days ago
Uhhh. I hated JS for years and years until I started to actually look at it.

If you just follow a few relatively simple rules JS is actually very nice and "reliable". Those "rules" are also relatively straight forward: let/const over var, === unless you know better, make sure you know about Number.isInteger, isSafeInteger, isObject etc etc. (there were a few more rules like this - fail to recall all of them - has been a few years since i touched JS) - hope you get the idea.

Also when I looked at JS I was just blown away by all the things people built on top of it (babel, typescript, flowtype, vue, webpack, etc etc).

1 comments

That's a pile of tricks, not a mental model though.

A mental model might be something like "JavaScript has strict and non-strict comparisons", but there are no strict less-than comparisons for example, so remembering to use === instead of == is just a one-off neat tip rather than an application of some more general rule.

I was not trying to imply that this is a mental model. I was merely commenting on OPs comment about JavaScript.