+ 2
Appear only on the fourth iteration
How can I make 'congrets' appear only on the fourth iteration if(Object.keys(num1)[i].length === 4) { correction.innerHTML = congrets; } else if (Object.keys(num1).length[i] < 1) { correction.innerHTML = "1st string"; } else { correction.innerHTML = "2nd string"; } https://code.sololearn.com/WT6RNLRf51xp/?ref=app
4 Antworten
+ 2
I see a potential error: you only have 1 equals operator in the if statement
+ 2
try
if(Object.keys(num1)[i].length === 4){
//your code goes here
}
+ 2
Oh my God. You guys are amazing.
The code:
if (i==3)
{
numcount.innerHTML = congrets;
}
works perfectly fine. It was really a lets go ahead and do this thing. This was really an innovation.
Moshe Schnitzler, Shadoff, Dragon God thank you for your support and help I appreciate it.
Thank you so much.
+ 1
//if iteration begins from zero
if (i==3){
//Your code
}
//if iteration begins from one
if (i==4){
//Your code
}