diff --git a/README.md b/README.md index eb2e006d0..4a3214633 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ Check if each value has already been added, using `includes()` on the accumulato ```js var uniqueValues = arr => arr.reduce( (acc, val) => { - if(acc.indexOf(val)) + if(!acc.includes(val)) acc.push(val); return acc; }, []);