Skip to content

Instantly share code, notes, and snippets.

@loicbourg
Created September 14, 2018 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loicbourg/6502168cd7c1c8a3706b75f4ec787581 to your computer and use it in GitHub Desktop.
Save loicbourg/6502168cd7c1c8a3706b75f4ec787581 to your computer and use it in GitHub Desktop.
bench-list
const list = [
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
];
const start = Date.now();
for (let i=0; i<100000; i++) {
let result = list.find((elem) => elem === 'h');
}
console.log(Date.now() - start);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment