Strukturat e kontrollit
Si të gjitha gjuhët e programimit, JavaScript ka disa struktura kontrolli siç janë:
If, Switch
JavaScript ofron dy strukturat më të njohura të kontrollit If dhe Switch
Struktura e kushtit If është si më poshtë. Kushti If mund të jetë i pasur me fjalën else mbas tij.
Shembull i kushtit IF :
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.07.11-PM.png)
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.10.32-PM.png)
Struktura e kushtit Switch:
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.08.45-PM.png)
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.11.40-PM-1024x777.png)
Ciklet
Janë tre struktura të cikleve , while, do while, dhe for.
Struktura e while:
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.17.46-PM.png)
Struktura e do while:
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.18.46-PM.png)
![](https://www.studentet.mk/wp-content/uploads/2019/03/Screen-Shot-2019-03-09-at-1.24.00-PM.png)