Last active
March 23, 2017 02:07
-
-
Save ascott/48f5b93ef90b00fa343892d39a5a85bf to your computer and use it in GitHub Desktop.
get long list of options to test select performance
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
// get long list of options to test select performance | |
function getFakeTableOptions(numOptions) { | |
let counter = 0; | |
let options = []; | |
const prefixes = ['foo', 'bar', 'baz', 'zeb', 'alpha', 'beta', 'xylo', 'superfragilistic', | |
'quick', 'brown', 'fox', 'jumped', 'over', 'lazy', 'dog', 'yak', 'cucumber']; | |
while (counter < numOptions) { | |
const label = `${prefixes[Math.floor(Math.random() * prefixes.length)]}--${counter}`; | |
options.push({ label: label, value: label }); | |
counter++; | |
} | |
return options; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment