JSFiddle - React, Tailwind, and code Playground

by evgkch

JavaScript

const arr = Array.from({ length: 9999999 }, (v, k) => k);
const newMap = new Map(arr.map((v, k) => [k,v]));

const timeTest = (callback) => {
	const start = new Date();
  callback();
  console.log(new Date() - start);
}; 

timeTest(() => {
	const el = arr.find(item => item === 9999998);
})

timeTest(() => {
	newMap.get(9999998)
})