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

Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekCzechDreamin
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxEasyPrinterHelp
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 

Recently uploaded (20)

Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 

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