I need the script to stop and wait 3 seconds before executing the code that follows (console.log('2 select question')).
var i = 0,
count = 5;
function f() {
if (i < count) {
i++;
console.log('Continue 1')
setTimeout(f, 1000);
} if (i >= count) {
console.log('2 select question')
console.log('3 select answer')
i = 0;
}
}
f();
Hello I don't know if i undrestand you but try this :
var i = 0,
count = 5;
function f() {
if (i < count) {
i++;
console.log('Continue 1')
setTimeout(f, 1000);
}
else if (i >= count) {
console.log('2 select question')
console.log('3 select answer')
i = 0;
}
}
f();