DEV Community

Cover image for JS Hack: Array & Duplicate Values

JS Hack: Array & Duplicate Values

Renato Byrro on October 08, 2019

This week's hack is about cleaning duplicate values from Arrays The Neat Dev version: let myArr = ['h', 'e', 'l', 'l', 'o...
Collapse
 
khuongduybui profile image
Duy K. Bui

Ninja code is bad - scratch that, legendary - in their readability and maintainability, not performance.

A true ninja would write

$: for(z in a) {

$$: for(g in u) {

and

break $$

Collapse
 
byrro profile image
Renato Byrro

True 😄