How to create button that leads a random 40% of people to one page and 60% to another?

@tony-brunsman How do i tell if it’s actually working? I’ve got the following below.

import wixLocation from 'wix-location';
let random = 0,counter1 = 0,counter99 = 0;

$w.onReady(function () {
 for (var i = 0; i < 10000000; i++) {
    random = Math.floor((Math.random() * 100) + 1);
 if (random <= 1.08)   {
        counter1++;
    } else {
        counter99++;
     }
  }
  console.log("counter1: " + counter1.toString());
  console.log("counter99: " + counter99.toString());
});

export function button2_click(event) {
random = Math.floor((Math.random(100000)) + 1);
 if (random <= 1060)   {
        wixLocation.to("https://www.google.com");
    } else {
        wixLocation.to("https://www.yahoo.com");
    }
}