Witam.
Mam taką oto funkcję i nie wiem jak spowodować aby funkcja wykonywała instrukcje "return" dopiero po zakończeniu działań w pętli "for".
function start()
{
var get_box = document.getElementById("content").childNodes;
for(x=0;x<30;x++)
{
(function (x)
{
setTimeout(function()
{
var active = document.getElementById("active");
if(active)
{
active.id = "";
}
var marked_box = get_box[test()];
marked_box.id = "active";
console.log(marked_box);
},x*100);
})(x)
return console.log(active);
}
}