SlideShare a Scribd company logo
1 of 40
Download to read offline
JAVASCRIPT
OPERATORS
Victor Perez
/ TO PRIMITIVE
⁄⁄⁄
● Preferred type, string or number
○ if no preferred type, default number except for instances of Date
CONVERSION
TO PRIMITIVE
⁄⁄⁄
● plus ( + )
● comparison ( <, <=, >, >=, ==, != )
○ in- and equality only if both aren't a object
PLUS AND COMPARISON
TO PRIMITIVE
/ OPERATORS
⁄⁄⁄
● Organized by operator precedence
● Punctuation characters
○ like: +, =, %
● Keywords
○ like: delete, void, typeof
● Associativity
○ LTR ( Left-to-right ) and RTL ( Right-to-left )
● Number of operands
○ 1 - 3
● Types
○ input type(s) → result type
INTRODUCTION
OPERATORS
⁄⁄⁄
INCREMENT
OPERATORS
● Pre- or post-increment
Operator Associativity Number of operands Types
++ Right-to-left 1 lvalue → number
⁄⁄⁄
DECREMENT
OPERATORS
● Pre- or post-decrement
Operator Associativity Number of operands Types
-- Right-to-left 1 lvalue → number
⁄⁄⁄
UNARY MINUS
OPERATORS
● Changes the sign of the result
Operator Associativity Number of operands Types
- Right-to-left 1 number → number
⁄⁄⁄
UNARY PLUS
OPERATORS
● Converts to a number
● See type conversion last presentation http://www.slideshare.net/victorandresperez/java-script-introduction-34306832/26
Operator Associativity Number of operands Types
+ Right-to-left 1 number → number
⁄⁄⁄
BITWISE NOT
OPERATORS
● Reversing all bits
● -( x + 1)
Operator Associativity Number of operands Types
~ Right-to-left 1 int → int
⁄⁄⁄
DELETE
OPERATORS
● Removes a property
○ returns true if the property was successful deleted
Operator Associativity Number of operands Types
delete Right-to-left 1 lvalue→ boolean
⁄⁄⁄
TYPEOF
OPERATORS
● Determine type of operand
○ http://www.slideshare.net/victorandresperez/java-script-introduction-34306832/25
Operator Associativity Number of operands Types
typeof Right-to-left 1 any → string
⁄⁄⁄
VOID
OPERATORS
● Evaluates its operand and then returns undefined
Operator Associativity Number of operands Types
void Right-to-left 1 any → undefined
⁄⁄⁄
MULTIPLY, DIVIDE & REMAINDER
OPERATORS
● Multiplication
● Division
● Modulo ( remainder after division )
Operator Associativity Number of operands Types
* Left-to-right 2 number, number → number
/ Left-to-right 2 number, number → number
% Left-to-right 2 number, number → number
⁄⁄⁄
ADD & SUBTRACT
OPERATORS
● Addition ( + )
● Subtraction ( - )
Operator Associativity Number of operands Types
+ Left-to-right 2 number, number → number
- Left-to-right 2 number, number → number
⁄⁄⁄
CONCATENATE STRINGS
OPERATORS
● Will concatenate both strings to a new string
Operator Associativity Number of operands Types
+ Left-to-right 2 string,string→ string
⁄⁄⁄
SHIFT LEFT
OPERATORS
● moves all bits in its first operand to the left by the number of places in the second operand
● between 0 and 31
● x * 2^y
Operator Associativity Number of operands Types
<< Left-to-right 2 int, int→ int
⁄⁄⁄
SHIFT RIGHT WITH SIGN
OPERATORS
● moves all bits in its first operand to the right by the number of places specified in the second operand
● between 0 and 31
Operator Associativity Number of operands Types
>> Left-to-right 2 int, int→ int
⁄⁄⁄
SHIFT RIGHT WITH ZERO FILL
OPERATORS
● Same as >> operator, except that the bits shifted in on the left are always zero
Operator Associativity Number of operands Types
>>> Left-to-right 2 int, int→ int
⁄⁄⁄
COMPARE NUMBERS
OPERATORS
● Less than ( < ), greater than ( > ), less than or equal ( <= ), greater than or equal ( >= )
Operator Associativity Number of operands Types
< Left-to-right 2 number, number→ boolean
> Left-to-right 2 number, number→ boolean
<= Left-to-right 2 number, number→ boolean
>= Left-to-right 2 number, number→ boolean
⁄⁄⁄
COMPARE STRINGS
OPERATORS
● Less than ( < ), greater than ( > ), less than or equal ( <= ), greater than or equal ( >= )
● 16-bit integers
● Capital ASCII is less than lowercase ASCII
Operator Associativity Number of operands Types
< Left-to-right 2 string, string → boolean
> Left-to-right 2 string, string → boolean
<= Left-to-right 2 string, string → boolean
>= Left-to-right 2 string, string → boolean
⁄⁄⁄
INSTANCEOF
OPERATORS
● Checks of the left operand is an instanceof the right operand
Operator Associativity Number of operands Types
instanceof Left-to-right 2 object,function→ boolean
⁄⁄⁄
IN
OPERATORS
● Checks of the left-side value is a property in the right-side value
Operator Associativity Number of operands Types
in Left-to-right 2 string,object→ boolean
⁄⁄⁄
EQUALITY
OPERATORS
● Checks of both operands are equal
● 2 objects are check by references
● Type conversion if types are not equal
Operator Associativity Number of operands Types
== Left-to-right 2 any,any→ boolean
⁄⁄⁄
INEQUALITY
OPERATORS
● Checks of both operands are not equal
● 2 objects are check by references
● Type conversion if types are not equal
Operator Associativity Number of operands Types
!= Left-to-right 2 any,any→ boolean
⁄⁄⁄
STRICT EQUALITY
OPERATORS
● Checks of both operands are equal
● 2 objects are check by references
Operator Associativity Number of operands Types
=== Left-to-right 2 any,any→ boolean
⁄⁄⁄
STRICT INEQUALITY
OPERATORS
● Checks of both operands are not equal
● 2 objects are check by references
Operator Associativity Number of operands Types
!== Left-to-right 2 any,any→ boolean
⁄⁄⁄
BITWISE AND
OPERATORS
● Performs the AND operation on each pair of bits
○ yields 1 if both bits are 1, else yields 0
Operator Associativity Number of operands Types
& Left-to-right 2 int,int→ int
⁄⁄⁄
BITWISE XOR
OPERATORS
● Performs the XOR operation on each pair of bits
○ yields 1 if both bits not equal, else yields 0
Operator Associativity Number of operands Types
^ Left-to-right 2 int,int→ int
⁄⁄⁄
BITWISE OR
OPERATORS
● Performs the OR operation on each pair of bits
○ yields 0 if both bits are 0, else yields 1
Operator Associativity Number of operands Types
| Left-to-right 2 int,int→ int
⁄⁄⁄
LOGICAL AND
OPERATORS
● Returns a “truthy” or “falsy” value
● Returns the left operand if the left operand is “falsy”, else return right operand
● “falsy” values are: false, null, undefined, 0, -0, NaN and empty string ( "" )
Operator Associativity Number of operands Types
&& Left-to-right 2 any,any→ any
⁄⁄⁄
LOGICAL OR
OPERATORS
● Returns a “truthy” or “falsy” value
● Returns the left operand if the left operand is “truthy”, else return right operand
● “falsy” values are: false, null, undefined, 0, -0, NaN and empty string ( "" )
Operator Associativity Number of operands Types
|| Left-to-right 2 any,any→ any
⁄⁄⁄
CONDITIONAL OPERATOR
OPERATORS
● The only ternary operator ( three operands )
● if first operand is “truly”, then the second operand is evaluated, else the third operand
Operator Associativity Number of operands Types
?: Right-to-left 3 boolean,any,any→ any
⁄⁄⁄
ASSIGNMENT
OPERATORS
● Assign to a variable or property
Operator Associativity Number of operands Types
= Right-to-left 2 lvalue,any→ any
⁄⁄⁄
OPERATE AND ASSIGN
OPERATORS
● a operate= b is the same as a = a operate b
Operators Associativity Number of operands Types
*=, /=, %=, +=, -=, &=, ^=,
|=, <<=, >>=, >>>=
Right-to-left 2 lvalue,any→ any
Operator Example Equivalent
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
|=
^=
a += b
a -= b
a *= b
a /= b
a %= b
a <<= b
a >>= b
a >>>= b
a &= b
a |= b
a ^= b
a = a + b
a = a - b
a = a * b
a = a / b
a = a % b
a = a << b
a = a >> b
a = a >>> b
a = a & b
a = a | b
a = a ^ b
⁄⁄⁄
COMMA
OPERATORS
● Evaluates the left operand, then the right operand and then returns the value of the right operand.
Operators Associativity Number of operands Types
, Left-to-right 2 any,any→ any
/ QUESTIONS?
THANKS
@VICTORAPEREZ
vpjs@victor-perez.nl

More Related Content

What's hot

Functional Javascript
Functional JavascriptFunctional Javascript
Functional Javascriptguest4d57e6
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Eugene Zharkov
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetHDR1001
 
Functions and Objects in JavaScript
Functions and Objects in JavaScript Functions and Objects in JavaScript
Functions and Objects in JavaScript Dhananjay Kumar
 
JavaScript: Patterns, Part 3
JavaScript: Patterns, Part  3JavaScript: Patterns, Part  3
JavaScript: Patterns, Part 3Chris Farrell
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript FunctionsColin DeCarlo
 
Functional Programming in JavaScript by Luis Atencio
Functional Programming in JavaScript by Luis AtencioFunctional Programming in JavaScript by Luis Atencio
Functional Programming in JavaScript by Luis AtencioLuis Atencio
 
Functional programming with Ruby - can make you look smart
Functional programming with Ruby - can make you look smartFunctional programming with Ruby - can make you look smart
Functional programming with Ruby - can make you look smartChen Fisher
 
Ruby Functional Programming
Ruby Functional ProgrammingRuby Functional Programming
Ruby Functional ProgrammingGeison Goes
 
Airbnb Javascript Style Guide
Airbnb Javascript Style GuideAirbnb Javascript Style Guide
Airbnb Javascript Style GuideCreative Partners
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScriptCodemotion
 
Maintainable JavaScript
Maintainable JavaScriptMaintainable JavaScript
Maintainable JavaScriptNicholas Zakas
 
Introduction to Object Oriented Javascript
Introduction to Object Oriented JavascriptIntroduction to Object Oriented Javascript
Introduction to Object Oriented Javascriptnodeninjas
 
Operator overloading
Operator overloadingOperator overloading
Operator overloadingArunaDevi63
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScriptWill Livengood
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modelingCodemotion
 

What's hot (20)

Scala - core features
Scala - core featuresScala - core features
Scala - core features
 
Operators in Java
Operators in JavaOperators in Java
Operators in Java
 
Functional Javascript
Functional JavascriptFunctional Javascript
Functional Javascript
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat Sheet
 
Functions and Objects in JavaScript
Functions and Objects in JavaScript Functions and Objects in JavaScript
Functions and Objects in JavaScript
 
JavaScript: Patterns, Part 3
JavaScript: Patterns, Part  3JavaScript: Patterns, Part  3
JavaScript: Patterns, Part 3
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript Functions
 
Let's JavaScript
Let's JavaScriptLet's JavaScript
Let's JavaScript
 
Functional Programming in JavaScript by Luis Atencio
Functional Programming in JavaScript by Luis AtencioFunctional Programming in JavaScript by Luis Atencio
Functional Programming in JavaScript by Luis Atencio
 
Functional programming with Ruby - can make you look smart
Functional programming with Ruby - can make you look smartFunctional programming with Ruby - can make you look smart
Functional programming with Ruby - can make you look smart
 
Ruby Functional Programming
Ruby Functional ProgrammingRuby Functional Programming
Ruby Functional Programming
 
Airbnb Javascript Style Guide
Airbnb Javascript Style GuideAirbnb Javascript Style Guide
Airbnb Javascript Style Guide
 
Client sidescripting javascript
Client sidescripting javascriptClient sidescripting javascript
Client sidescripting javascript
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
 
Maintainable JavaScript
Maintainable JavaScriptMaintainable JavaScript
Maintainable JavaScript
 
Introduction to Object Oriented Javascript
Introduction to Object Oriented JavascriptIntroduction to Object Oriented Javascript
Introduction to Object Oriented Javascript
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScript
 
From object oriented to functional domain modeling
From object oriented to functional domain modelingFrom object oriented to functional domain modeling
From object oriented to functional domain modeling
 

Similar to JavaScript operators (20)

Java script operators
Java script operatorsJava script operators
Java script operators
 
operators in c++
operators in c++operators in c++
operators in c++
 
operators in c++
operators in c++operators in c++
operators in c++
 
OPERATORS OF C++
OPERATORS OF C++OPERATORS OF C++
OPERATORS OF C++
 
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
 
c# operators
c# operatorsc# operators
c# operators
 
SPL 6 | Operators in C
SPL 6 | Operators in CSPL 6 | Operators in C
SPL 6 | Operators in C
 
Operators in C/C++
Operators in C/C++Operators in C/C++
Operators in C/C++
 
Operators
OperatorsOperators
Operators
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Operators in c++
Operators in c++Operators in c++
Operators in c++
 
itft-Operators in java
itft-Operators in javaitft-Operators in java
itft-Operators in java
 
Operators in java
Operators in javaOperators in java
Operators in java
 
10)OPERATORS.pdf
10)OPERATORS.pdf10)OPERATORS.pdf
10)OPERATORS.pdf
 
Logical Operators C/C++ language Programming
Logical Operators C/C++ language ProgrammingLogical Operators C/C++ language Programming
Logical Operators C/C++ language Programming
 
SQL Operator.pdf
SQL Operator.pdfSQL Operator.pdf
SQL Operator.pdf
 
Operators
OperatorsOperators
Operators
 
Operator 04 (js)
Operator 04 (js)Operator 04 (js)
Operator 04 (js)
 
Opeartor &amp; expression
Opeartor &amp; expressionOpeartor &amp; expression
Opeartor &amp; expression
 

Recently uploaded

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 

Recently uploaded (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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...
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 

JavaScript operators

  • 1.
  • 4. ⁄⁄⁄ ● Preferred type, string or number ○ if no preferred type, default number except for instances of Date CONVERSION TO PRIMITIVE
  • 5. ⁄⁄⁄ ● plus ( + ) ● comparison ( <, <=, >, >=, ==, != ) ○ in- and equality only if both aren't a object PLUS AND COMPARISON TO PRIMITIVE
  • 7. ⁄⁄⁄ ● Organized by operator precedence ● Punctuation characters ○ like: +, =, % ● Keywords ○ like: delete, void, typeof ● Associativity ○ LTR ( Left-to-right ) and RTL ( Right-to-left ) ● Number of operands ○ 1 - 3 ● Types ○ input type(s) → result type INTRODUCTION OPERATORS
  • 8. ⁄⁄⁄ INCREMENT OPERATORS ● Pre- or post-increment Operator Associativity Number of operands Types ++ Right-to-left 1 lvalue → number
  • 9. ⁄⁄⁄ DECREMENT OPERATORS ● Pre- or post-decrement Operator Associativity Number of operands Types -- Right-to-left 1 lvalue → number
  • 10. ⁄⁄⁄ UNARY MINUS OPERATORS ● Changes the sign of the result Operator Associativity Number of operands Types - Right-to-left 1 number → number
  • 11. ⁄⁄⁄ UNARY PLUS OPERATORS ● Converts to a number ● See type conversion last presentation http://www.slideshare.net/victorandresperez/java-script-introduction-34306832/26 Operator Associativity Number of operands Types + Right-to-left 1 number → number
  • 12. ⁄⁄⁄ BITWISE NOT OPERATORS ● Reversing all bits ● -( x + 1) Operator Associativity Number of operands Types ~ Right-to-left 1 int → int
  • 13. ⁄⁄⁄ DELETE OPERATORS ● Removes a property ○ returns true if the property was successful deleted Operator Associativity Number of operands Types delete Right-to-left 1 lvalue→ boolean
  • 14. ⁄⁄⁄ TYPEOF OPERATORS ● Determine type of operand ○ http://www.slideshare.net/victorandresperez/java-script-introduction-34306832/25 Operator Associativity Number of operands Types typeof Right-to-left 1 any → string
  • 15. ⁄⁄⁄ VOID OPERATORS ● Evaluates its operand and then returns undefined Operator Associativity Number of operands Types void Right-to-left 1 any → undefined
  • 16. ⁄⁄⁄ MULTIPLY, DIVIDE & REMAINDER OPERATORS ● Multiplication ● Division ● Modulo ( remainder after division ) Operator Associativity Number of operands Types * Left-to-right 2 number, number → number / Left-to-right 2 number, number → number % Left-to-right 2 number, number → number
  • 17. ⁄⁄⁄ ADD & SUBTRACT OPERATORS ● Addition ( + ) ● Subtraction ( - ) Operator Associativity Number of operands Types + Left-to-right 2 number, number → number - Left-to-right 2 number, number → number
  • 18. ⁄⁄⁄ CONCATENATE STRINGS OPERATORS ● Will concatenate both strings to a new string Operator Associativity Number of operands Types + Left-to-right 2 string,string→ string
  • 19. ⁄⁄⁄ SHIFT LEFT OPERATORS ● moves all bits in its first operand to the left by the number of places in the second operand ● between 0 and 31 ● x * 2^y Operator Associativity Number of operands Types << Left-to-right 2 int, int→ int
  • 20. ⁄⁄⁄ SHIFT RIGHT WITH SIGN OPERATORS ● moves all bits in its first operand to the right by the number of places specified in the second operand ● between 0 and 31 Operator Associativity Number of operands Types >> Left-to-right 2 int, int→ int
  • 21. ⁄⁄⁄ SHIFT RIGHT WITH ZERO FILL OPERATORS ● Same as >> operator, except that the bits shifted in on the left are always zero Operator Associativity Number of operands Types >>> Left-to-right 2 int, int→ int
  • 22. ⁄⁄⁄ COMPARE NUMBERS OPERATORS ● Less than ( < ), greater than ( > ), less than or equal ( <= ), greater than or equal ( >= ) Operator Associativity Number of operands Types < Left-to-right 2 number, number→ boolean > Left-to-right 2 number, number→ boolean <= Left-to-right 2 number, number→ boolean >= Left-to-right 2 number, number→ boolean
  • 23. ⁄⁄⁄ COMPARE STRINGS OPERATORS ● Less than ( < ), greater than ( > ), less than or equal ( <= ), greater than or equal ( >= ) ● 16-bit integers ● Capital ASCII is less than lowercase ASCII Operator Associativity Number of operands Types < Left-to-right 2 string, string → boolean > Left-to-right 2 string, string → boolean <= Left-to-right 2 string, string → boolean >= Left-to-right 2 string, string → boolean
  • 24. ⁄⁄⁄ INSTANCEOF OPERATORS ● Checks of the left operand is an instanceof the right operand Operator Associativity Number of operands Types instanceof Left-to-right 2 object,function→ boolean
  • 25. ⁄⁄⁄ IN OPERATORS ● Checks of the left-side value is a property in the right-side value Operator Associativity Number of operands Types in Left-to-right 2 string,object→ boolean
  • 26. ⁄⁄⁄ EQUALITY OPERATORS ● Checks of both operands are equal ● 2 objects are check by references ● Type conversion if types are not equal Operator Associativity Number of operands Types == Left-to-right 2 any,any→ boolean
  • 27. ⁄⁄⁄ INEQUALITY OPERATORS ● Checks of both operands are not equal ● 2 objects are check by references ● Type conversion if types are not equal Operator Associativity Number of operands Types != Left-to-right 2 any,any→ boolean
  • 28. ⁄⁄⁄ STRICT EQUALITY OPERATORS ● Checks of both operands are equal ● 2 objects are check by references Operator Associativity Number of operands Types === Left-to-right 2 any,any→ boolean
  • 29. ⁄⁄⁄ STRICT INEQUALITY OPERATORS ● Checks of both operands are not equal ● 2 objects are check by references Operator Associativity Number of operands Types !== Left-to-right 2 any,any→ boolean
  • 30. ⁄⁄⁄ BITWISE AND OPERATORS ● Performs the AND operation on each pair of bits ○ yields 1 if both bits are 1, else yields 0 Operator Associativity Number of operands Types & Left-to-right 2 int,int→ int
  • 31. ⁄⁄⁄ BITWISE XOR OPERATORS ● Performs the XOR operation on each pair of bits ○ yields 1 if both bits not equal, else yields 0 Operator Associativity Number of operands Types ^ Left-to-right 2 int,int→ int
  • 32. ⁄⁄⁄ BITWISE OR OPERATORS ● Performs the OR operation on each pair of bits ○ yields 0 if both bits are 0, else yields 1 Operator Associativity Number of operands Types | Left-to-right 2 int,int→ int
  • 33. ⁄⁄⁄ LOGICAL AND OPERATORS ● Returns a “truthy” or “falsy” value ● Returns the left operand if the left operand is “falsy”, else return right operand ● “falsy” values are: false, null, undefined, 0, -0, NaN and empty string ( "" ) Operator Associativity Number of operands Types && Left-to-right 2 any,any→ any
  • 34. ⁄⁄⁄ LOGICAL OR OPERATORS ● Returns a “truthy” or “falsy” value ● Returns the left operand if the left operand is “truthy”, else return right operand ● “falsy” values are: false, null, undefined, 0, -0, NaN and empty string ( "" ) Operator Associativity Number of operands Types || Left-to-right 2 any,any→ any
  • 35. ⁄⁄⁄ CONDITIONAL OPERATOR OPERATORS ● The only ternary operator ( three operands ) ● if first operand is “truly”, then the second operand is evaluated, else the third operand Operator Associativity Number of operands Types ?: Right-to-left 3 boolean,any,any→ any
  • 36. ⁄⁄⁄ ASSIGNMENT OPERATORS ● Assign to a variable or property Operator Associativity Number of operands Types = Right-to-left 2 lvalue,any→ any
  • 37. ⁄⁄⁄ OPERATE AND ASSIGN OPERATORS ● a operate= b is the same as a = a operate b Operators Associativity Number of operands Types *=, /=, %=, +=, -=, &=, ^=, |=, <<=, >>=, >>>= Right-to-left 2 lvalue,any→ any Operator Example Equivalent += -= *= /= %= <<= >>= >>>= &= |= ^= a += b a -= b a *= b a /= b a %= b a <<= b a >>= b a >>>= b a &= b a |= b a ^= b a = a + b a = a - b a = a * b a = a / b a = a % b a = a << b a = a >> b a = a >>> b a = a & b a = a | b a = a ^ b
  • 38. ⁄⁄⁄ COMMA OPERATORS ● Evaluates the left operand, then the right operand and then returns the value of the right operand. Operators Associativity Number of operands Types , Left-to-right 2 any,any→ any