JavaScript code to estimate the value of PI using Monte Carlo simulations