(b) Explain if-else statement with example in JavaScrip t
Answers
Answered by
0
Answer:
In JavaScript, an if-else statement is used to specify a condition and what to do when the condition is either true or false.
For example, to increase a number by one until it reaches ten we can use an if-else statement.
var num = 1;
if (1 === 10) {
text ("Reached 10!", 0, 0, 100)
};
else {
num ++;
};
Hope it helps!
Answered by
4
Answer:
ʏօʊʀ ǟռֆաɛʀ ɨֆ ɨռ ȶɦɛ ǟȶȶǟƈɦʍɛռȶ.
Attachments:
Similar questions