• Home
  • About Us
  • Courses
  • Accreditation
  • FAQ
  • Academic Study Center
  • E-Learning
  • Contact Us
  • aecu

  • JavaScript Home
  • JavaScript Introduction
  • JavaScript How To
  • JavaScript Where To
  • JavaScript Statements
  • JavaScript Comments
  • JavaScript Variables
  • JavaScript Operators
  • JavaScript Comparisom
  • JavaScript If....Else
  • JavaScript Switch
  • JavaScript Popup Boxes
  • JavaScript Functions
  • JavaScript For Loop
  • JavaScript While Loop
  • JavaScript Break Loop
  • JavaScript For....In
  • JavaScript Events
  • JavaScript Try....Catch
  • JavaScript Throw
  • JavaScript Special Text
  • JavaScript Guidelines
  • JavaScript Ojects Intro
  • JavaScript String
  • JavaScript Date
  • JavaScript Array
  • JavaScript Boolean
  • JavaScript Math
  • JavaScript RegExp
  • JavaScript Brower
  • JavaScript Cookies
  • JavaScript Validation
  • JavaScript Animation
  • JavaScript Image Maps
  • JavaScript Timing
  • JavaScript Create Object
  • JavaScript Summary

  • Learn at your own pace

JavaScript Comparison and Logical Operators

Previous Chapter
Next Chapter

Comparison and Logical operators are used to test for true or false.


Comparison Operators

Comparison operators are used in logical statements to determine equality or difference between variables or values.
Given that x=5, the table below explains the comparison operators:

y=5;
z=2;
x=y+z;

The value of x, after the execution of the statements above is 7.


JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic between variables and/or values.
Given that y=5, the table below explains the arithmetic operators:
Operator Description Example
== is equal to x==8 is false
=== is exactly equal to (value and type) x===5 is true
x==="5" is false
!= is not equal x!=8 is true
> is greater than x>8 is false
<