It's funny how the language you primarily work with changes your perspective.
JavaScript supports "object spreading", which lets you do this:
let foo = { x: 1, y: 2 };
...
let { x, y } = foo;
console.log(x + y); // 3
A common pattern is to use this as a stand-in for named/unordered function arguments: function bar({ x, y }) {
return x + y;
}
bar({ x: 3, y: 4 });
// or...
let foo = { x: 1, y: 2 };
bar(foo);
Which is pretty much exactly the "epiphany" at the bottom (the interchangeability of these two). I don't mean to diminish the author's thought process; I just think it's fascinating how different programming languages (even ones so similar in syntax) dramatically shape the way one thinks about a given problem.