2
2ality
2ality.com · Personal blog · on HN since 2011
Axel Rauschmayer writes about JavaScript and ECMAScript features, proposals, and internals, and also authors free online books on the language.
What HN saysHN commenters praise it as an excellent, long-running JavaScript blog that digs into language internals, and recommend his free books too.
267HN people shared it
118linked it in comments
349stories submitted
3.9Kstory points
5 months agolast shared
2011people per year2026
Most-shared posts
- 12ality blog: temporarily offline due to AI stealing work19 people · 4 points · first shared 2016 · 1 comments on HN
- 2ECMAScript 2018: final feature set7 people · 191 points · first shared 2017 · 109 comments on HN
- 3The final feature set of ECMAScript 2016 (ES7)7 people · 8 points · first shared 2016 · discussion on HN
- 4Google SoundScript: faster OOP for JavaScript6 people · 88 points · first shared 2015 · 60 comments on HN
- 5Tail call optimization in ECMAScript 66 people · 62 points · first shared 2015 · 13 comments on HN
- 6ES proposal: import()6 people · 10 points · first shared 2017 · discussion on HN
- 7A pipe operator for JavaScript: introduction and use cases5 people · 158 points · first shared 2022 · 104 comments on HN
- 8Fake Operator Overloading in JavaScript (2011)5 people · 58 points · first shared 2013 · 11 comments on HN
- 9JavaScript’s a mess – and that’s a good thing5 people · 9 points · first shared 2018 · discussion on HN
- 10Statically Typed JavaScript via TypeScript,Flow and AtScript5 people · 8 points · first shared 2014 · discussion on HN
- 11What’s in ECMAScript 2016 (ES7)?5 people · 6 points · first shared 2015 · discussion on HN
- 12The history of “typeof null”5 people · 5 points · first shared 2016 · 1 comments on HN
- 13Avoiding versioning in ECMAScript 65 people · 2 points · first shared 2014 · discussion on HN
- 14ECMAScript modules in Node.js: the new plan4 people · 216 points · first shared 2018 · 125 comments on HN
- 15Currying is not idiomatic in JavaScript4 people · 73 points · first shared 2017 · 55 comments on HN
What HN people wrote when they linked it
heisenbit · 2026-06-16
Some of the best books on JS which were online went recently off-line for that reason. Blog post by the author: https://2ality.com/ (Dr. Axel Rauschmayer)
threatofrain · 2022-02-07
https://2ality.com/ (by Dr. Axel Rauschmayer, amazing JS blog)
dvaun · 2020-08-21
Check out 2ality[0]. The blog author delves into ECMAScript internals and specific concepts (e.g. hoisting, scope nuances based on variable declaration, etc.) with great details.
[0]: https://2ality.com/
frou_dh · 2018-02-08
Rauschmayer is a good writer - He's been running a great JS blog for many years (http://2ality.com/)
johnhenry · 2017-06-01
I've only read parts, but Dr. Axel Rauschmayer has a few good books; Speaking JavaScript, Exploring ES2016, and more available free online here: http://exploringjs.com/. He also has an insightful blog here: http://2ality.com/
vmasto · 2016-11-15
Dr. Rauschmayer also maintains one of the best blogs about Javascript http://www.2ality.com
koshelew · 2017-06-11
Having conducted over 100 interviews for JS positions, here is my advice.
- You have to start with ECMA5. 95% of new features in later versions can be transpiled back to it, and examining resulting code is usually the easiest way to comprehend them. Oh, how many candidates I've seen that talk about 'modern classes' with a flare and then can't explain prototypical inheritance at all. So, the best start is "JavaScript: The Definitive Guide, 6th Edition".
- Be very careful about what you read online. Blog platforms are full of script kiddies trying to feed you their misconceptions without a second thought. I generally only 'trust' two sources - Mozilla Developer Network and http://2ality.com/ by Axel Rauschmayer (I believe his books are mentioned in other answers too).
- Whenever you are faced with a particular library/technology - look from books/posts from their creators or someone associated with them.
WorldMaker · 2025-06-27
You don't need Array.from if you are using `for (const x of document.querySelectorAll(selector) { }` loops anyway or have a library like IxJS handy.
ES2025 added map, filter, flatMap, reduce, forEach, and several other methods to all iterators (including NodeList directly, I believe, but definitely its entries(), keys(), values(), if not) [1]. It'll be a year or two at current pace before that is "widely accepted baseline" in browsers, but it's great progress on these sorts of complaints.
[1] https://2ality.com/2025/06/ecmascript-2025.html#iterator-helper-method…
e1g · 2022-11-20
For JS in general: anything from https://2ality.com - articles, books, walk-throughs, etc. Axel is thorough and systemically reconstructs complex topics from core building blocks.
For Cloudflare Workers specifically: first, learn regular Web Workers, then read everything from kentonv who's the tech lead for CF Workers, and a user here. He's written many (disjointed) pieces on Workers both here on HN and on the CF community board. Additionally, Cloudflare Developers Discord (https://discord.com/invite/cloudflaredev) has a very active channel for Workers with people discussing implementation details and edge cases.
niels_bom · 2022-07-14
As a programming teacher I think this is quite a fundamental thing to learn for new programmers. Even though lots of tutorials and books don't mention this explicitly people usually get an intuition for the difference after a while.
But in the beginning it's hard for people to grok an expression with a couple of nested expressions in it. Especially if there's some functions calls in there as well.
Axel Rauschmayer has a good page (1) on this topic as well. Quite dry, so less beginner friendly.
So what I like about Josh W Comeau's article is that it's easy to read with lots of examples and even an interactive widget.
Oh and about interactive visualization of expression evaluation: Thonny (2) does this real nicely for Python code. Excellent for beginners imo.
[1] https://2ality.com/2012/09/expressions-vs-statements.html
[2] https://thonny.org/
gherkinnn · 2022-05-16
Defaulting to data-last gets you 80% of the way.
fn = (a -> b) -> a
So your typical array mapping becomes
list.map(to(v => v * 2))
All very contrived of course.
Ramda’s currying [0] gives you the _ param to play with the order. But I’ve come to the conclusion that currying in JS is rarely worth the effort. [1]
0 - https://github.com/ramda/ramda/blob/v0.28.0/source/__.js
1 - https://2ality.com/2017/11/currying-in-js.html
Pr0ject217 · 2022-02-07
EDIT:
Paste this hacky snippet into your browser's console to save all of the links into your clipboard:
(() =>
{
let result = [...document.querySelectorAll('td a')]
.map((link) =>
link &&
!link.href.includes('ycombinator') &&
!link.href.includes('javascript:void')
? link.href
: ''
)
.filter(Boolean);
result = [...new Set(result)];
result.sort();
copy(result.join('\n\n'));
})();
Just to help, here's a compiled-list of all of the links shared here so…
amalive · 2021-06-10
Haven't read it but since it from the same author who writes these 'to the point' blogs - https://2ality.com/ I believe the quality would be good.
protoduction · 2020-11-18
I love how simple and effective this is.
I'm also building a web-based literate programming environment called Starboard[1] that's probably a hundred times the amount of code (but then it has additional features such as top-level await, plugin, and Python support).
Consider supporting lit-html[2] literals instead of strings for HTML output, it works really well in notebook environments.
One more thing you can consider: a esm tagged literal that uses import(<data url of the code>), you can then use ES Module imports to dynamically load code. Here's a blog post about that approach [3]
[1]: https://starboard.gg
[2]: https://lit-html.polymer-project.org/
[3]: https://2ality.com/2019/10/eval-via-import.html
jstewartmobile · 2019-01-28
> Is CSS an "art" thing?
Certainly![0]
> Is it common for other developers to have issues with it?
Boy howdy it is! Like eight years of discussion[1] on vertically centering text in a div. It's all siegeworks-engineering[2] anyway, so no surprise that we ended up here.
I think at one point in time, poor Doug Crockford suggested actual versioning for things like javascript and CSS. The children shivered as though they had been visited by a ghost! And after brushing the chill aside, returned to our great undertaking of cramming as many different languages into a .js file as humanly possible.
[0] https://www.widewalls.ch/andy-warhol-piss-paintings/
[1] https://stackoverflow.com/questions/2939914/how-do-i-vertically-align-…
[2] http://2ality.com/2011/03/javascript-how-it-all-began.html
m0meni · 2018-04-10
http://2ality.com and everything else by the author including these books on modern JS http://exploringjs.com are gold.
supernumerary · 2017-07-31
I need to remind myself to read these more often.
http://shop.oreilly.com/product/9780596517748.do
http://2ality.com/
Very useful day-to-day and first place I go:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
zbuttram · 2017-07-24
Surprised to see http://2ality.com/ missing. First place I go for every new JavaScript lang feature/proposal.
Fannon · 2017-03-12
http://www.2ality.com/ for deeper insight in JavaScript and its current development.
mabynogy · 2017-03-03
My favorites are missing: http://exploringjs.com/
From Axel Rauschmayer: http://www.2ality.com/p/about.html
lewisl9029 · 2016-03-24
> Are dynamic inclusions simply not allowed?
Correct. One of the motivating factors for ES6 modules was to create a format that can be statically analyzed and optimized.
> Is eval just not allowed to import anything?
Correct.
See this excellent writeup for more details regarding ES6 modules:
http://www.2ality.com/2014/09/es6-modules-final.html
draw_down · 2016-02-11
Here is a great link from today. "JavaScript fatigue fatigue" http://www.2ality.com/2016/02/js-fatigue-fatigue.html
> Don’t try to know everything – it’s impossible in modern web development.
funksta · 2015-03-26
This is destructuring (a new feature in ES6, the upcoming version of JavaScript). There's a great in-depth read on how it works here: http://www.2ality.com/2015/01/es6-destructuring.html
acjohnson55 · 2013-09-13
That's a pretty awesome hack of JS's (rather insane) semantics. It's probably worth understanding at least the primative examples though if you're a JS programmer, because this actually happens sometimes to expressions you write.
For a little bit of insight into why []+[] === '', for example, check this out: http://www.2ality.com/2012/01/object-plus-object.html
bzbarsky · 2012-03-13
> Given that Mozilla aren't willing to redesign their browser
> to eliminate the recurring flaws
http://www.2ality.com/2012/02/servo.html is worth a read.
> Chrome is the only browser going along these lines
Chrome is using a C++ core with no plans to stop doing that that I know of....
iceIX · 2020-04-27
cdax · 2017-10-25
In "traditional" recursion, each recursive call is pushed onto the function call stack. This means that your recursive solution will eventually run out of memory when the number of recursive calls is more than what the function call stack can handle.
e.g., consider the following recursive solution for calculating the sum of all positive integers up to a given `n`:
fn sum(n):
if n == 0:
return 0
else:
return n + sum(n - 1) // A
When n = 1000, your function call stack will have to hold ~1000 calls (fn(1000), fn(999), fn(998), fn(997), and so on...), before it's able to compute the sum. This is because the return statement in line A above, needs to keep track of the variable `n` from the calling function in order to be able to compute the return value. If only there was some way to eliminate that variable `n`...
That's where tail-recursion or tail-call optimization comes in:
fn sum_tail(n, pre_sum):
if n == 0:
return pre_sum
return sum_tail(n - 1, pre_sum + n) // B
fn sum(n):
return sum_tail(n, 0)
In this solution, the return statement at line B does not depend on any variable from the calling function (it simply passes that value on to next function call), and so the calling function can immediately be popped off the stack, saving stack space and making your solution more memory-efficient.
It's useful to know that whether any stack space can actually be saved, depends on whether your language of choice implements…
chubot · 2012-04-09
Take a look at ECMAScript quasi-literals -- they are solving the same problem that you're trying to address:
http://wiki.ecmascript.org/doku.php?id=harmony:quasis
http://www.2ality.com/2011/09/quasi-literals.html
I think they are going further because they can do auto-escaping. From what I see of your language, you still have to do html:"$var". What happens if you mis-type the prefix? Do you get incorrect escaping and a security hole? Some web devs won't even know what language they're writing in.
FWIW I don't think it's worth building an entire language around this concept. It's a feature, not a language. I think using Python plus a template language with good escaping basically solves the problem.
Also, it would be weird if html: and sql: are built in to the language -- that should be a layer on top of a smaller language (just like quasi-literals).
Also, a server-side language with special escaping support doesn't seem compelling, because these days you would want special escaping support on the client too. I'm not sure of the status of quasi-literals, but if they make it into V8 then Node.JS will have this feature on the server.
andrewl-hn · 2025-11-07
The article lists all flashy JavaScript proposals, and none of them are part of the language.
Here’s what actually is new: https://2ality.com/2025/06/ecmascript-2025.html
XCSme · 2025-01-24
Latest Node can run TypeScript: https://2ality.com/2025/01/nodejs-strip-type.html