SlideShare a Scribd company logo
1 of 23
Operators and Statements
       Session 9
Objectives
   Describe assignment operators
   Explain bitwise operators
   Explain switch-case statement
   Describe regular expression
Types of Operators
   Operators help in simplifying expressions.
   JavaScript provides a predefined set of operators
    that allow you to perform different operations.
   Arithmetic operators
   Relational operators
   Logical operators
   Assignment operators
   Bitwise operators
   Special operators
Arithmetic Operator
   Arithmetic operators are binary operators, as they
    perform basic arithmetic operator on two operand.
Increment and decrement operators
   The increment operator (++) increases the value
    by 1, while the decrement operator(--) decreases
    the value by 1.
Relational Operators
   Relational operators are binary operators that make compare
    between two operands. They return a boolean value
    namely, true or false.
Logical Operators
   Logical operators are binary operators that perform logical
    operations on two operands.
Assignment Operators
 Assignmentoperator performs operations between the two
operands and assign the result to its left operand.
Bitwise Operators
Bitwise operators perform operations on the corresponding
individual bits of two operands.
Special Operators
•There are some operators in Javascript, which do not
belong to any of the categories of JavaScript operators
String Operators
Can merge two string values that are assigned to
two different variables.

  Operator         Descriptin                 Example
  +                Concatenates two or        var fullname=‘John’ + ‘ ’ +
                   more strings into a        ‘Blake’;
                   single string              fullname=‘John Blake’
  +=               Concatenates to or         var flower=‘Rose’;
  (Add-By-Value)   more strings and           flower +=‘’ + ‘flower’;
                   assign the result to its   flower =‘Rose Flower’;
                   left operant
Shift Operators
Shift operators are binary bitwise operators that perform shift operations on
bits. The first operand is the decimal number on which the shift operation is
performed. The second operand specifies the number or bit positions by
which the bits are to be shifted.
 Operator       Description                     Example
 <<             Shift the bit positions         8<<2 yield 32,because 00001000
 (Left Shift    towards the left by shifting    shifted by 2 bits becomes
 Operator)      the number of bits in the       00100000,which is 32. Here, the
                left at the right               two leftmost bits are placed toward
                                                the right
 >>             Shift the bit positions         8>>2 yield 32,because 00001000
 (Right Shift   towards the right by shifting   shifted by 2 bits becomes
 Operator)      the number of bits in the       00000010,which is 2. Here, the
                right at the left               two rightmost bits are placed
                                                toward the left.
Decision – making Statement
Decision-making statement s allow implementing logical
decision for executing different block to obtain the desired
output. They execute a block of statements depending upon a
boolean condition.
This condition is an expression that returns either true or
false.
Javascript supports four decision-making statements :
    If
    If-else
    If-else if else
    switch
The “if” Statement
The if statement executes a block of
statements based on a logical boolean
condition.
The “if-else” Statement
The if statement specifies a block of
statement to be executed when the
condition in the if statement is true, and
it’s requires to define a block of
statements to be executed when a
conditions evaluated to false
The “if-else if ” Statement
The if-else if statements allow you
to check multiple conditions and
specify a different block to be
execute for each condition.
Nested “if” Statement
The nested if statements comprises of
multiple if statements within an if
statement.
“Switch-case” Statement
To simplify the coding and avoid using multiple if
statement, switch-case statement can be used as a
different approach to code the same logic
Regular Expressions
 A regular expression is a pattern, whose purpose is to help in
validating the text format
 Example:
Types
Character or symbols allow matching a substring that exists at
a specific position within a string.
Types
Characters or symbols are combined to form character classes for
specifying patterns.
Summary
The & operator perform bitwise AND operation and
returns the result to the operand on the left hand side
The | operator performs bitwise OR operation and
returns the result to the operand on the left hand side
The ^ operator performs bitwise XOR operation and
returns the result to the operand on the left hand side
The string concatenation operator combine different
strings into single string.
Summary…
   The left shift operator shifts the bits on the
    leftmost side toward the right.
   The right shift operator shifts the bits on the
    rightmost side toward the left.
   Nested switch-case construct refers to including
    a switch-case construct within a case block.



                                  Building Dynamic Websites/Session 1/ 23 of 16

More Related Content

What's hot

Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in JavaAbhilash Nair
 
Chapter 13.1.2
Chapter 13.1.2Chapter 13.1.2
Chapter 13.1.2patcha535
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)rnkhan
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in javaAtul Sehdev
 
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentationkunal kishore
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statementEyelean xilef
 
OCA JAVA - 3 Programming with Java Operators
 OCA JAVA - 3 Programming with Java Operators OCA JAVA - 3 Programming with Java Operators
OCA JAVA - 3 Programming with Java OperatorsFernando Gil
 
Transformation of Classical Fractals applying Fractional Operators
Transformation of Classical Fractals applying Fractional OperatorsTransformation of Classical Fractals applying Fractional Operators
Transformation of Classical Fractals applying Fractional OperatorsMariela Marín
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.netJaya Kumari
 
Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)Alin Pandichi
 

What's hot (18)

Operators and Expressions in Java
Operators and Expressions in JavaOperators and Expressions in Java
Operators and Expressions in Java
 
Chapter 13.1.2
Chapter 13.1.2Chapter 13.1.2
Chapter 13.1.2
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Operators
OperatorsOperators
Operators
 
Js ch-1
Js ch-1Js ch-1
Js ch-1
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)
 
Java 2
Java 2Java 2
Java 2
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in java
 
Operators in java presentation
Operators in java presentationOperators in java presentation
Operators in java presentation
 
Variable, constant, operators and control statement
Variable, constant, operators and control statementVariable, constant, operators and control statement
Variable, constant, operators and control statement
 
OCA JAVA - 3 Programming with Java Operators
 OCA JAVA - 3 Programming with Java Operators OCA JAVA - 3 Programming with Java Operators
OCA JAVA - 3 Programming with Java Operators
 
Transformation of Classical Fractals applying Fractional Operators
Transformation of Classical Fractals applying Fractional OperatorsTransformation of Classical Fractals applying Fractional Operators
Transformation of Classical Fractals applying Fractional Operators
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
 
Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)Covariance and contravariance. Say what?! (Agile Talks #22)
Covariance and contravariance. Say what?! (Agile Talks #22)
 
05 operators
05   operators05   operators
05 operators
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 

Viewers also liked

12. session 12 java script objects
12. session 12   java script objects12. session 12   java script objects
12. session 12 java script objectsPhúc Đỗ
 
15. session 15 data binding
15. session 15   data binding15. session 15   data binding
15. session 15 data bindingPhúc Đỗ
 
10. session 10 loops and arrays
10. session 10   loops and arrays10. session 10   loops and arrays
10. session 10 loops and arraysPhúc Đỗ
 
11. session 11 functions and objects
11. session 11   functions and objects11. session 11   functions and objects
11. session 11 functions and objectsPhúc Đỗ
 
08. session 08 intoduction to javascript
08. session 08   intoduction to javascript08. session 08   intoduction to javascript
08. session 08 intoduction to javascriptPhúc Đỗ
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with javaMohamed Fathy
 
07. session 07 adv css properties
07. session 07   adv css properties07. session 07   adv css properties
07. session 07 adv css propertiesPhúc Đỗ
 
Java Course 3: OOP
Java Course 3: OOPJava Course 3: OOP
Java Course 3: OOPAnton Keks
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtmlPhúc Đỗ
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsRaja Sekhar
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01Adil Kakakhel
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Javawiradikusuma
 

Viewers also liked (16)

12. session 12 java script objects
12. session 12   java script objects12. session 12   java script objects
12. session 12 java script objects
 
15. session 15 data binding
15. session 15   data binding15. session 15   data binding
15. session 15 data binding
 
10. session 10 loops and arrays
10. session 10   loops and arrays10. session 10   loops and arrays
10. session 10 loops and arrays
 
11. session 11 functions and objects
11. session 11   functions and objects11. session 11   functions and objects
11. session 11 functions and objects
 
08. session 08 intoduction to javascript
08. session 08   intoduction to javascript08. session 08   intoduction to javascript
08. session 08 intoduction to javascript
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with java
 
07. session 07 adv css properties
07. session 07   adv css properties07. session 07   adv css properties
07. session 07 adv css properties
 
Java Course 3: OOP
Java Course 3: OOPJava Course 3: OOP
Java Course 3: OOP
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
 
13. session 13 introduction to dhtml
13. session 13   introduction to dhtml13. session 13   introduction to dhtml
13. session 13 introduction to dhtml
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwords
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
 

Similar to 09. session 9 operators and statements

Cse lecture-4.2-c bit wise operators and expression
Cse lecture-4.2-c bit wise operators and expressionCse lecture-4.2-c bit wise operators and expression
Cse lecture-4.2-c bit wise operators and expressionFarshidKhan
 
Operators in Python
Operators in PythonOperators in Python
Operators in PythonAnusuya123
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.pptRithwikRanjan
 
data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de laLEOFAKE
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
C bitwise operators
C bitwise operatorsC bitwise operators
C bitwise operatorsSuneel Dogra
 
Chapter 8 Operators and Expressions.pptx
Chapter 8 Operators and Expressions.pptxChapter 8 Operators and Expressions.pptx
Chapter 8 Operators and Expressions.pptxRaviBala18
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statementsİbrahim Kürce
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptxclassall
 
Bit shift operators
Bit shift operatorsBit shift operators
Bit shift operatorsalldesign
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.pptbalewayalew
 

Similar to 09. session 9 operators and statements (20)

Cse lecture-4.2-c bit wise operators and expression
Cse lecture-4.2-c bit wise operators and expressionCse lecture-4.2-c bit wise operators and expression
Cse lecture-4.2-c bit wise operators and expression
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt4_A1208223655_21789_2_2018_04. Operators.ppt
4_A1208223655_21789_2_2018_04. Operators.ppt
 
Operator 04 (js)
Operator 04 (js)Operator 04 (js)
Operator 04 (js)
 
Types of Operators in C
Types of Operators in CTypes of Operators in C
Types of Operators in C
 
Operators and it's type
Operators and it's type Operators and it's type
Operators and it's type
 
Report on c
Report on cReport on c
Report on c
 
data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Java basic operators
Java basic operatorsJava basic operators
Java basic operators
 
C bitwise operators
C bitwise operatorsC bitwise operators
C bitwise operators
 
Chapter 8 Operators and Expressions.pptx
Chapter 8 Operators and Expressions.pptxChapter 8 Operators and Expressions.pptx
Chapter 8 Operators and Expressions.pptx
 
Operators in java
Operators in javaOperators in java
Operators in java
 
Java script session 4
Java script session 4Java script session 4
Java script session 4
 
Unit 2.5
Unit 2.5Unit 2.5
Unit 2.5
 
OCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & StatementsOCA Java SE 8 Exam Chapter 2 Operators & Statements
OCA Java SE 8 Exam Chapter 2 Operators & Statements
 
Java - Operators
Java - OperatorsJava - Operators
Java - Operators
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptx
 
Bit shift operators
Bit shift operatorsBit shift operators
Bit shift operators
 
PE1 Module 2.ppt
PE1 Module 2.pptPE1 Module 2.ppt
PE1 Module 2.ppt
 

More from Phúc Đỗ

15. session 15 data binding
15. session 15   data binding15. session 15   data binding
15. session 15 data bindingPhúc Đỗ
 
14. session 14 dhtml filter
14. session 14   dhtml filter14. session 14   dhtml filter
14. session 14 dhtml filterPhúc Đỗ
 
06. session 06 css color_andlayoutpropeties
06. session 06   css color_andlayoutpropeties06. session 06   css color_andlayoutpropeties
06. session 06 css color_andlayoutpropetiesPhúc Đỗ
 
05. session 05 introducing css
05. session 05   introducing css05. session 05   introducing css
05. session 05 introducing cssPhúc Đỗ
 
04. session 04 working withformsandframes
04. session 04   working withformsandframes04. session 04   working withformsandframes
04. session 04 working withformsandframesPhúc Đỗ
 
03. session 03 using lists and tables
03. session 03   using lists and tables03. session 03   using lists and tables
03. session 03 using lists and tablesPhúc Đỗ
 
02. session 02 working with html elements
02. session 02   working with html elements02. session 02   working with html elements
02. session 02 working with html elementsPhúc Đỗ
 
01. session 01 introduction to html
01. session 01   introduction to html01. session 01   introduction to html
01. session 01 introduction to htmlPhúc Đỗ
 

More from Phúc Đỗ (8)

15. session 15 data binding
15. session 15   data binding15. session 15   data binding
15. session 15 data binding
 
14. session 14 dhtml filter
14. session 14   dhtml filter14. session 14   dhtml filter
14. session 14 dhtml filter
 
06. session 06 css color_andlayoutpropeties
06. session 06   css color_andlayoutpropeties06. session 06   css color_andlayoutpropeties
06. session 06 css color_andlayoutpropeties
 
05. session 05 introducing css
05. session 05   introducing css05. session 05   introducing css
05. session 05 introducing css
 
04. session 04 working withformsandframes
04. session 04   working withformsandframes04. session 04   working withformsandframes
04. session 04 working withformsandframes
 
03. session 03 using lists and tables
03. session 03   using lists and tables03. session 03   using lists and tables
03. session 03 using lists and tables
 
02. session 02 working with html elements
02. session 02   working with html elements02. session 02   working with html elements
02. session 02 working with html elements
 
01. session 01 introduction to html
01. session 01   introduction to html01. session 01   introduction to html
01. session 01 introduction to html
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

09. session 9 operators and statements

  • 2. Objectives  Describe assignment operators  Explain bitwise operators  Explain switch-case statement  Describe regular expression
  • 3. Types of Operators  Operators help in simplifying expressions.  JavaScript provides a predefined set of operators that allow you to perform different operations.  Arithmetic operators  Relational operators  Logical operators  Assignment operators  Bitwise operators  Special operators
  • 4. Arithmetic Operator  Arithmetic operators are binary operators, as they perform basic arithmetic operator on two operand.
  • 5. Increment and decrement operators  The increment operator (++) increases the value by 1, while the decrement operator(--) decreases the value by 1.
  • 6. Relational Operators  Relational operators are binary operators that make compare between two operands. They return a boolean value namely, true or false.
  • 7. Logical Operators  Logical operators are binary operators that perform logical operations on two operands.
  • 8. Assignment Operators  Assignmentoperator performs operations between the two operands and assign the result to its left operand.
  • 9. Bitwise Operators Bitwise operators perform operations on the corresponding individual bits of two operands.
  • 10. Special Operators •There are some operators in Javascript, which do not belong to any of the categories of JavaScript operators
  • 11. String Operators Can merge two string values that are assigned to two different variables. Operator Descriptin Example + Concatenates two or var fullname=‘John’ + ‘ ’ + more strings into a ‘Blake’; single string fullname=‘John Blake’ += Concatenates to or var flower=‘Rose’; (Add-By-Value) more strings and flower +=‘’ + ‘flower’; assign the result to its flower =‘Rose Flower’; left operant
  • 12. Shift Operators Shift operators are binary bitwise operators that perform shift operations on bits. The first operand is the decimal number on which the shift operation is performed. The second operand specifies the number or bit positions by which the bits are to be shifted. Operator Description Example << Shift the bit positions 8<<2 yield 32,because 00001000 (Left Shift towards the left by shifting shifted by 2 bits becomes Operator) the number of bits in the 00100000,which is 32. Here, the left at the right two leftmost bits are placed toward the right >> Shift the bit positions 8>>2 yield 32,because 00001000 (Right Shift towards the right by shifting shifted by 2 bits becomes Operator) the number of bits in the 00000010,which is 2. Here, the right at the left two rightmost bits are placed toward the left.
  • 13. Decision – making Statement Decision-making statement s allow implementing logical decision for executing different block to obtain the desired output. They execute a block of statements depending upon a boolean condition. This condition is an expression that returns either true or false. Javascript supports four decision-making statements : If If-else If-else if else switch
  • 14. The “if” Statement The if statement executes a block of statements based on a logical boolean condition.
  • 15. The “if-else” Statement The if statement specifies a block of statement to be executed when the condition in the if statement is true, and it’s requires to define a block of statements to be executed when a conditions evaluated to false
  • 16. The “if-else if ” Statement The if-else if statements allow you to check multiple conditions and specify a different block to be execute for each condition.
  • 17. Nested “if” Statement The nested if statements comprises of multiple if statements within an if statement.
  • 18. “Switch-case” Statement To simplify the coding and avoid using multiple if statement, switch-case statement can be used as a different approach to code the same logic
  • 19. Regular Expressions  A regular expression is a pattern, whose purpose is to help in validating the text format  Example:
  • 20. Types Character or symbols allow matching a substring that exists at a specific position within a string.
  • 21. Types Characters or symbols are combined to form character classes for specifying patterns.
  • 22. Summary The & operator perform bitwise AND operation and returns the result to the operand on the left hand side The | operator performs bitwise OR operation and returns the result to the operand on the left hand side The ^ operator performs bitwise XOR operation and returns the result to the operand on the left hand side The string concatenation operator combine different strings into single string.
  • 23. Summary…  The left shift operator shifts the bits on the leftmost side toward the right.  The right shift operator shifts the bits on the rightmost side toward the left.  Nested switch-case construct refers to including a switch-case construct within a case block. Building Dynamic Websites/Session 1/ 23 of 16