Last active
March 15, 2022 17:54
-
-
Save jzevin/4f756cdeb5ad1b4dd642c2d0e06ef207 to your computer and use it in GitHub Desktop.
rnd
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
const log = console.log.bind(console); | |
const $ = document.querySelector.bind(document); | |
const $$ = document.querySelectorAll.bind(document); | |
const rnd = { | |
color: () => `#${Math.floor(Math.random()*16777215).toString(16)}`, | |
dec: (min=0.0,max=1.0) => Math.random() * (max - min) + min, | |
int: (min=0,max=1) => Math.floor(Math.random() * (max - min + 1) + min), | |
pick: (array) => array[Math.floor(Math.random() * array.length)] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment