Last active
June 5, 2020 12:26
-
-
Save jamesmcallister/9fa2513a5ea446712e43550f79fe9d89 to your computer and use it in GitHub Desktop.
whiskybase random tipple
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
function whichWeDram() { | |
const openBottles = [...document.getElementsByClassName("shelft-bottle-open")].map( | |
({ firstElementChild }) => firstElementChild.dataset.title, | |
); | |
const closedBottles = [...document.getElementsByClassName("shelft-bottle-closed")].map( | |
({ firstElementChild }) => firstElementChild.dataset.title, | |
); | |
const openBottle = openBottles[Math.floor(Math.random() * openBottles.length)]; | |
const closedBottle = closedBottles[Math.floor(Math.random() * closedBottles.length)]; | |
return { | |
"feeling brave": closedBottle, | |
"how about this one" :openBottle | |
} | |
}; | |
whichWeDram() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment