Skip to content

Instantly share code, notes, and snippets.

View Crawron's full-sized avatar
🦜

Aaron Crawron

🦜
View GitHub Profile
function simulatePoll(limit) {
const votes = [0, 0]
for (let i = 0; i < limit; i++) {
const rgn = Math.floor(Math.random() * 100 + 1)
if (rgn <= 1) votes[0] = votes[0] + 1
else votes[1] = votes[1] + 1
}
return votes
}