That functions and closures are core elements of the language. You can assign functions to variables, return them from other functions, pass to other functions as parameters and thanks to closures do easy currying.
This opens amazing possibilities for functional programming. Having some experience with ramda.js and crocks.js, I am fairly positive THIS is the power of the language. Sadly, not all of the devs get it and try to write ‘this’, classes and do monstrosity like Angular. Even React is not yet utilising full power it could utilise.
When I understood that a browser is so much more than a JavaScript interpreter.
It's crazy how different things can behave in Safari.
And things look and work differently even in Chrome on Windows vs. Chrome on MacOS.
There was a point about 20 years ago, when I finally understood the underlying concepts (RegExp was suddenly fun, I soon started to overuse them, but that's a different story).
However, since then, I had a fair share of great "aha" moments, e.g. when finally understanding react fibers after reading the source code or after listening to Ryan Carniato talk about reactivity in Solid.js (his understanding of the topic is deeper than anyone's I've ever met).
Probably when I started reading and trying my best to understand how modern frameworks are implemented. I'm still pursuing this, and probably it will never end, but it was the last aha moment I experienced in the javascript world.
Latest comments (23)
Figuring out the whole callback/promise/async tower of abstractions sure was a bit of an AHA! moment, but not of the good kind.
To this day I am convinced callbacks and the many attempts to make them more usable are an inferior mechanism for handling asynchronicity in code.
It was aha
That functions and closures are core elements of the language. You can assign functions to variables, return them from other functions, pass to other functions as parameters and thanks to closures do easy currying.
This opens amazing possibilities for functional programming. Having some experience with ramda.js and crocks.js, I am fairly positive THIS is the power of the language. Sadly, not all of the devs get it and try to write ‘this’, classes and do monstrosity like Angular. Even React is not yet utilising full power it could utilise.
Finding out how
this
works. Very eye-opening.understand between reference type and value type. how does it change my object or array?
When I understood that a browser is so much more than a JavaScript interpreter.
It's crazy how different things can behave in Safari.
And things look and work differently even in Chrome on Windows vs. Chrome on MacOS.
There was a point about 20 years ago, when I finally understood the underlying concepts (RegExp was suddenly fun, I soon started to overuse them, but that's a different story).
However, since then, I had a fair share of great "aha" moments, e.g. when finally understanding react fibers after reading the source code or after listening to Ryan Carniato talk about reactivity in Solid.js (his understanding of the topic is deeper than anyone's I've ever met).
Probably when I started reading and trying my best to understand how modern frameworks are implemented. I'm still pursuing this, and probably it will never end, but it was the last aha moment I experienced in the javascript world.
When I change OOP to functional programming, forget the this, and implement pipeline operator in my stack.