+ 1
I DONT UNDERSTAND
why should I use if or elseif or for or etc ? while I can just omit them and only use alert or document.write ?
6 Respuestas
+ 5
If else and loops are fundamental of every language and you can find it in every code.
You should not use doc.write in real website it is just for example purpose.
Main use of Js is to add interactivity and to change html and css as per requirements.
Hope this helps ☺️☺️.
+ 5
If this also helps
Conditional Statement :
Conditional statement are used to control the flow means if some condition is true than only execute certain statement.
Loops :
Loops are used to repeat a block of statement if certain condition are true.
+ 4
Alert and loops are completely different concept so dont get confuse in that.
They are not alternatives.
And happy it helped☺️☺️.
+ 3
There is called conditional statement, we use if and else to let program runs 2 different state based on different condition.
This is what's program language meant for, it helps us to decide the actions to run based on different inputs.
+ 2
oh , thank you . thumbs up 👍
+ 1