> I think you could write that like this:
> 
>    outer = outer.filter(arr =>
>      !arr.some((e, i) =>
>        i > 0 && arr[i-1] === e));

Yes, you are of course correct. What I was doing in the originally cited code 
was illustrating using how `reduce(..)` by its nature supports the adjacency 
check, instead of using indexes and manual `i-1` type logic.

IOW, I initially wanted to avoid the ugly `i-1`, and I traded that for the 
unfortunate lack of early exit necessitating the equally ugly `prev === false`. 
:/



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to