Where did you copy this code from? It’s not on the right track at all and there are many errors.
For information on correct usage of the button’s link property, see the link API . Also, refer to the documentation on wixLocation.to() .
Your button click event handler should look something like this (not tested):
export function button3_click(event) {
let randomIndex = Math.floor(Math.random() * (allUrls.length - 1));
let link = allUrls[randomIndex];
wixLocation.to(link);
}