Last active
November 6, 2020 15:25
-
-
Save mgamini/dcd41e52a8d594b0e653b5caf69c3e20 to your computer and use it in GitHub Desktop.
Wyomings calculator
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
// Nav to the NYT election page: | |
// https://www.nytimes.com/interactive/2020/11/03/us/elections/results-president.html | |
// Open developer tools | |
// Paste the code below | |
// note: pasting code you don't understand into your browser is very dangerous. | |
// If you don't understand what this code is doing, don't do it. | |
const POP_OF_WYOMING = 578759 | |
window.alert(`Biden is winning by ${([...document.querySelectorAll('.e-all-text')].reduce((arr, node) => Math.abs(arr - parseInt(node.innerText.replaceAll(',',''))), 0) / POP_OF_WYOMING).toFixed(2)} Wyomings`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment