Hacker News new | ask | show | jobs
by cgdub 1685 days ago
If you use a sufficiently smart JS optimizer, it will optimize the object creation and destructuring away.

For example, Google Closure Compiler can take

    function hello({name}) {
      alert('Hello, ' + name);
    }
    
    hello({name: 'World'});
and compile it into

    alert("Hello, World");
1 comments

An alternate universe where Closure Compiler became the preferred way to build JS projects would be interesting.

Clojurescript made that choice, though in retrospect it kind of seems like they backed the wrong horse.