JSFiddle - React, Tailwind, and code Playground
JavaScript
// All numbers are equal
var numberOne = 3;
var numberTwo = 3;
var numberThree = 3;
// run this loop until numberOne is different than numberThree
while(numberOne === numberThree)
{
numberOne = Math.floor(Math.random() * 4);
}
// run this loop until numberTwo is different than numberThree and numberOne
while(numberTwo === numberThree || numberTwo === numberOne)
{
numberTwo = Math.floor(Math.random() * 4);
}
console.log(numberOne);
console.log(numberTwo);
console.log(numberThree);