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