News for hackers. Stuff that matters.
Re:7 JavaScript hacks for ES6 hipsters by ng12 on Thursday November 30, 2017 @05:30PM (#15820226)
Why are these "hipster hacks"? They're really important language features everyone should be using.

Side note: has anybody ever had to actually swap variables in production code? I thought it was just a fizzbuzz interview question.

Re:7 JavaScript hacks for ES6 hipsters by mabynogy on Thursday November 30, 2017 @08:16PM (#15821197)
> has anybody ever had to actually swap variables in production code?

I did that today to swap the content of two plain objects without altering the references.

It was in Lua but I'll probably to that in JS too tomorrow.

Re:7 JavaScript hacks for ES6 hipsters by tal_berzniz on Thursday November 30, 2017 @05:45PM (#15820340)
The "hipster hacks" are things you not necessarily use but are fun things to try. Some of these are for fun (like #1) and others (like #2) are day to day life-savers.

Indeed the swap variables is a fun fact.

Re:7 JavaScript hacks for ES6 hipsters by ix-hispana on Friday December 01, 2017 @05:12AM (#15823010)
The ...thing still feels like magic to me.

The rest are pretty common, I would not consider reduce() or passing an object to a function instead of separate arguments hipster hacks at all. "Options" objects are ubiquitous in corporate SDKs like AWS and Azure. They are the opposite of hipster.

Re:7 JavaScript hacks for ES6 hipsters by tal_berzniz on Friday December 01, 2017 @07:17AM (#15823380)
Options indeed was always a common use case but made the function declaration less verbose. Now we can have the best of both worlds