WEB PERFORMANCE

Should You Use .includes or .filter to Check if An Array Contains an Item?

Either method can work. Array.prototype.filter() is infinitely more powerful than Array.prototype.includes(), while the .includes() method is easier to read and offers much better performance.

Dr. Derek Austin šŸ„³
8 min readMar 11, 2021

--

Photo by Athena Lam on Unsplash

--

--

I love working with Next.js + Tailwind CSS ā™¦ Lead UI / UX Product Engineer ā™¦ React Software Architect ā™¦ SEO & Web Performance Expert ā™¦ I love accessibility šŸ„°