0% found this document useful (0 votes)
0 views

JS2 ClassNotes

The document provides an overview of JavaScript operators, including arithmetic, assignment, comparison, and logical operators. It also covers conditional statements such as if, if-else, and else-if, as well as ternary operators. Additionally, it includes practice questions for user input and grading based on scores.

Uploaded by

rashidk
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

JS2 ClassNotes

The document provides an overview of JavaScript operators, including arithmetic, assignment, comparison, and logical operators. It also covers conditional statements such as if, if-else, and else-if, as well as ternary operators. Additionally, it includes practice questions for user input and grading based on scores.

Uploaded by

rashidk
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

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

You might also like