I am trying to randomly select a function from an array of different functions. In the console it says "[Function: cycle3]" so it IS telling me which function is being chosen, however the code inside the function is not ran. How can I get the code inside the randomly chosen function to run?
var robot = require('robotjs');
function cycle1() {
robot.moveMouse(0,0)
}
function cycle2() {
robot.moveMouse(1920, 1080);
}
function cycle3() {
robot.moveMouse(0, 1080);
}
var myArray = [cycle1, cycle2, cycle3];
var randomValue = myArray[Math.floor(Math.random() * myArray.length)];
console.log(randomValue);