I am trying to use the developer mode to code a button that redirects to one of 6 links randomly
Here is the code I have. I copied it from a website and made some changes, I am not a programmer so pls help
export function button1_click(entry) {
var links = new Array();
links[0] = "https://www.google.com";
links[1] = "https://www.amazon.com";
links[2] = "https://www.apple.com";
links[3] = "https://www.reddit.com";
links[4] = "https://www.youtube.com";
links[5] = "https://www.bing.com";
var i = Math.floor(Math.random() * links.length);
$w('#button1').onClick.link = 'links[i]';
$w('#button1').onClick.target = '_self';
return false;}