Skip to content

Instantly share code, notes, and snippets.

@thealphadollar
Last active January 28, 2022 16:41
Show Gist options
  • Save thealphadollar/9978339285b7aecaf60dd41e62495f7e to your computer and use it in GitHub Desktop.
Save thealphadollar/9978339285b7aecaf60dd41e62495f7e to your computer and use it in GitHub Desktop.
// create list of list with three strings each
strings = [
["p1", "p2", "p3"],
["p4", "p5", "p6"],
["p7", "p8", "p9"]
]
// function to return a random row of the input list
function getRow() {
return strings[Math.floor(Math.random() * strings.length)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment