JSFiddle - React, Tailwind, and code Playground

by Lalji Tadhani

JavaScript

let tickets = 35000;


setInterval(function(){
  console.log(tickets);
  const random = Math.floor(Math.random()*(350-100+1)+100);
  let sum = tickets + random;
  let totalSum = sum + random;

  console.log('Total sum =' + totalSum);

  if (tickets >= 60000) {
    console.log("Sold out");
    clearInterval();
  }
}, 1000);