Good morning, I'm starting on nodejs. I need to make a function that is called inside the other go back to my loop, however I'm having difficulty with this. Segua down the code I made. From loop to function test2 and from test2 to test3 and from test3 rec
var teste3 = function teste3(n){
if (n == 2 || n == 4) {
console.log("chego na 3")
return;
};
}
var teste2 = function teste2(n, callback){
if (n == 1 || n == 5) {
console.log("chego no 2")
}else if (n == 2 || n == 4){
callback(n);
}
}
var i = 0;
var teste = function teste(){
while(i < 10){
teste2(i, teste3);
console.log(i);
i++
}
}
teste();