Page 86 - DCAP202_Fundamentals of Web Programming
P. 86
Manpreet Kaur, Lovely Professional University Unit 7: Operators in JavaScript
Unit 7: Operators in JavaScript Notes
CONTENTS
Objectives
Introduction
7.1 Operators
7.1.1 Arithmetic Operators
7.1.2 Bitwise Operators
7.1.3 Assignment Operators
7.1.4 Increment Operators
7.1.5 Comparison Operators
7.1.6 Logical Operators
7.1.7 Other Operators
7.1.8 Operator’s Precedence
7.2 Expressions
7.2.1 Conditional Expression
7.3 Summary
7.4 Keywords
7.5 Review Questions
7.6 Further Readings
Objectives
After studying this unit, you will be able to:
Discuss about the operators used in JavaScript
Explain how to use operators in JavaScript?
Understand what is the precedence of operators in JavaScript?
Describe what are the expressions in JavaScript?
Introduction
An operator is a symbol (it can also be a word) that performs calculations, comparisons or
assignment on one or more values. Much of the work in scripts is done by operators.
7.1 Operators
The most common operators are mathematical operators; +, -, /, * (add, subtract, divide, multiply)
for example. Operators can be split into two groups, comparison operators and assignment or
‘action’ operators. Comparison operators test to see if two variables relate to each other in the
specified way.
LOVELY PROFESSIONAL UNIVERSITY 79