I hope your code doesn't actually look like that
you do not need to give all of the functions their own function......
function main() { balls.add(1);
window.minimize();
window.maximize();
game.start();
return 1;
}