JavaScript Control Statements
Notes:
JavaScript Control Statements:
Note: Control statements help us to get the control over flow of execution of a code.
Note: We can solve any real world problem by writing a program containing four programming language statements: sequential, conditional, control transfer and iterative statements.
0. Sequential statements: don’t break the normal flow of execution of code
Ex: variable declarations, assignment statements etc.
var a;
a=10;
3 types of control statements:
1. Conditional / selection: execute code based the result of a condition
if,
if else,
else if ladder,
switch case
2. Jumping / control transfer: make the control to jump/ transfer directly from one place to another
break,
continue,
function call,
return
3. Looping / Iterative: execute set of statements repeatedly
for,
while,
do while,
for in
Interview Questions: