JAVASCRIPT: Conditional Control Structure, Iterative Control Structure, and Break Keyword

preview_player
Показать описание
Conditional statements control behaviour in JavaScript and determine whether or not pieces of code can run.
The condition specified in the #conditionalstatement can either be true or false.
We have four types of conditional statements in JavaScript:

1. if statement: executes a specified code segment if the given condition is ''true.''
2. if-else statement: executes the code associated with the else if the given if condition is ''false.''
3. if-elseif-else statement: specifies a new condition for testing when the first if condition is ''false.''
4. switch-case statement: specifies multiple alternative code blocks for execution and executes these cases based on certain conditions.

𝐁𝐫𝐞𝐚𝐤 𝐤𝐞𝐲𝐰𝐨𝐫𝐝 𝐢𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭:
The break statement breaks out of a switch or a loop.
In a switch, it breaks out of the switch block. This stops the execution of more code inside the switch.
In a loop, it breaks out of the loop and continues executing the code after the loop (if any).

In JavaScript, variables can be declared in 4 ways, using var, using let, using const and using nothing. In this video, declaration and difference of let and var keywords are explained.

𝐖𝐡𝐚𝐭 𝐢𝐬 𝐈𝐭𝐞𝐫𝐚𝐭𝐢𝐯𝐞 #ControlStructureJavaScript?
It is a quick and easy way to do something repeatedly.
There is 3 types of #JavaScriptLoops:
1. while loop: executes its statements as long as a specified condition evaluates to true.
2. do...while loop: repeats until a specified condition evaluates to false.
3. for loop: repeats until a specified condition evaluates to false.

Check out some more latest videos:

𝐓𝐀𝐁𝐋𝐄 𝐎𝐅 𝐂𝐎𝐍𝐓𝐄𝐍𝐓

0:20 What is Conditional Control Structure in JavaScript?
1:22 if statement in JavaScript
3:29 if-else statement JavaScript
4:06 JavaScript Program to Check if a Number is Positive or Negative
4:34 JavaScript Program to Check if a Number is Odd or Even
5:46 if-elseif-else statement JavaScript
10:19 switch statement in JavaScript
14:47 How to use escape sequences in JavaScript?
15:21 break keyword in JavaScript
17:18 Declaration of Variables in JavaScript
18:23 let keyword in JavaScript
18:52 var vs let JavaScript
21:04 Iterative Control Structure is JavaScript
21:09 while loop in JavaScript
26:15 do...while loop in JavaScript
29:15 for loop in JavaScript
35:58 break keyword in loops
Рекомендации по теме
join shbcf.ru