function randomInteger(min, max) { let rand = min + Math.random() * (max + 1 - min); return Math.floor(rand); } var test = new Vizz("res", "#03afcc"); var d = []; document.getElementById('vizz').style.background = '#3f51b5'; $.doTimeout('someid', 100, function ( ) { for (var i = 0; i < 10; i++) { d[i] = randomInteger(0, 10); } test.mode_1(d, 100, 100, true, 'sqr', 105); test.glitch(1, 20, 1, 30); return true; }, true);