Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
75 views

JS2 ClassNotes

The document discusses different types of operators in JavaScript including arithmetic, assignment, comparison, logical, and ternary operators. It also covers conditional statements such as if, if-else, and else-if statements. The document concludes with examples of letting users practice coding questions involving operators and conditional statements.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

JS2 ClassNotes

The document discusses different types of operators in JavaScript including arithmetic, assignment, comparison, logical, and ternary operators. It also covers conditional statements such as if, if-else, and else-if statements. The document concludes with examples of letting users practice coding questions involving operators and conditional statements.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Comments in JS

Part of Code which is not executed

lege
Col
pna
A
Operators in JS
Used to perform some operation on data

e
Arithmetic Operators

+, -, *, /
lleg
a Co
Modulus

Exponentiation Apn
Increment

Decrement
Operators in JS
Assignment Operators

= += -= *= %= **=

lege
Col
pna
A
Operators in JS
Comparison Operators

Equal to ==
ge
Equal to & type

le
===
Not equal to !=
Col
Not equal to & type !==

pna
>, >=, <, <= A
Operators in JS
Logical Operators

Logical AND &&

lege
Col
a
||
n
Logical OR

Logical NOT ! Ap
Conditional Statements
To implement some condition in the code

if Statement

lege
Col
pna
A
Conditional Statements
if-else Statement

lege
Col
pna
A
Conditional Statements
else-if Statement

lege
Col
pna
A
Operators in JS
Ternary Operators

ge
condition ? true output : false output

olle
na C
Ap
MDN Docs

lege
Col
pna
A
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.

lege
Col
pna
A
Let‘s Practice
Qs2. Write a code which can give grades to students according to their scores:
80-100, A

e
70-89, B

eg
60-69, C
50-59, D

Coll
a
0-49, F

Apn

You might also like