Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cryptocurrency.js
let valueInUSD = 1
setInterval(() => {
valueInUSD = Math.max(valueInUSD + (Math.random() >= 0.5 ? 1 : -1) * Math.random() / (5 * Math.random()), 0.1)
console.log('valueInUSD', valueInUSD)
}, 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment