Skip to content

Instantly share code, notes, and snippets.

@madewulf
Created October 7, 2020 12:53
Show Gist options
  • Save madewulf/2f48f510ba44f39fee8bc47213e7cac8 to your computer and use it in GitHub Desktop.
Save madewulf/2f48f510ba44f39fee8bc47213e7cac8 to your computer and use it in GitHub Desktop.
s = new Set();
for (i = 0 ; i < 500000; i++)
s.add(""+i);
count = 0;
for (i = 0 ; i < 500000; i++)
if (s.has(""+i))
count = count + 1;
console.log(count);
@madewulf
Copy link
Author

madewulf commented Oct 7, 2020

This creates a set of 500 000 strings and then checks if they are in the set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment