Created
September 14, 2018 15:31
-
-
Save loicbourg/6502168cd7c1c8a3706b75f4ec787581 to your computer and use it in GitHub Desktop.
bench-list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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