function createFunctions() { var result = new Array(); for (var i = 0; i < 10; i++) { result[i] = function () { return i; }; } return result; }
<!DOCTYPE html> <html > <head> </head> <body> <script> aLoops = []; aLoops[0] = new Audio('media/background.ogg'); aLoops[0].volume = 0.3; alert("43434"); aLoops[0].play(); </script>