Comments in JS
Part of Code which is not
executed
Operators in JS
Used to perform some operation
on data
Arithmetic Operators
+, -, *, /
Modulus Exponentiation
Increment Decrement
Operators in JS
Assignment Operators
= += -= % **
*= = =
Operators in JS
Comparison
Operators
Equal
to
= Equal to &
type
==
Not equal = ! Not equal to & =
to type
= !
=
>, >=,
=
<, <=
Operators in JS
Logical
Operators
Logical &
AND
&
Logical
OR
||
Logical
NOT
!
Conditional Statements
To implement some condition in
the code
if Statement
Conditional Statements
if-else
Statement
Conditional Statements
else-if
Statement
Operators in JS
Ternary Operators
condition ? true output : false
output
MDN Docs
Let‘s Practice
Qs1. Get user to input a number using prompt(“Enter a number:”). Check if
the number is a multiple of 5 or not.
Let‘s Practice
Qs2. Write a code which can give grades to students according to
their scores: 80-100, A
70-89, B
60-69, C
50-59, D
0-49, F