Skip to content

Instantly share code, notes, and snippets.

View queviva's full-sized avatar

queviva

View GitHub Profile
@queviva
queviva / randIntBetween.js
Last active January 31, 2022 22:16
returns a random integer between two other values
const randIntBetween = (x, y) => ~~(Math.random() * (x - y) ) + x
@queviva
queviva / XbetweenYandZ.js
Created January 31, 2022 05:19
method that quickly tells you if a value, x, is between any two other unknown values, y and z
const XbetweenYandZ = (x, y, z) => (x-y) * (x-z) < 0;
@queviva
queviva / gate.js
Created January 26, 2022 00:02
gate value between values
const gate = (...v) => v.sort((a, b) => a - b)[1];