Collection of JS one-liners.

I am a huge fan of Arrow functions. They have changed the way we write code. They have cured the cloudy behaviour of this . They let us define functions without function keyword 😅. This article collates one-liners — written using arrow functions — with their explanations.

Remove Duplicates from Array

Interviewer often asks candidates to write a function which removes duplicates from an array. This can be done in many ways. We’ll discuss only those which are relevant to this post.