0
for(let i = 1;i <= 2;i++) {
    const a = prompt("first question ?",""),    
    b = +prompt("second question?" , "");
}

does declaration of variables in for means that every time the loop works the new variable is created but if it is so doesn't the creating of two identical variables is a mistake?

VLAZ
  • 22,934
  • 9
  • 44
  • 60
  • "*does declaration of variables in for means that every time the loop works the new variable is created*" yes. "*doesn't the creating of two identical variables is a mistake?*" why would it be? – VLAZ Nov 07 '21 at 09:18

0 Answers0