DEV Community

Discussion on: 15 must-know JavaScript array methods in 2020

Collapse
 
pszndr profile image
Paulo

I personally like includes() for transforming a code like

if (value === 1 || value === 2 || value === 3) {...}

into

if ([1, 2, 3].includes(value)) {...}

Collapse
 
ibrahima92 profile image
Ibrahima Ndaw

It's a very handy method.