JSFiddle - React, Tailwind, and code Playground
by evgkch
JavaScript
const results = [];
function test() {
results.push(((5 * Math.random()) - (2 * Math.random())) > 1)
}
for (let i = 0; i < 100000; i++)
test();
console.log(results.filter((res) => res == true).length / results.length);