phuocng / 1loc

What's your favorite JavaScript single LOC (line of code)?

Home Page:https://phuoc.ng/collection/1-loc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assigning to a new array literal does not empty an array

marlowpayne opened this issue · comments

const empty = arr => arr = [];

This code snippet will not empty the arr argument, as shown below:

Screen Shot 2020-04-24 at 8 25 51 AM

It was my mistake while trying to push many snippets :)
It's fixed now.