let example = 5;
let val = 6;
example == 10 //(false) This line translates to "is the value of example equal to 10?"
example == 5 //(true)
example == val //(false)
val = 5;
example == val
Operator: ===
Examples:
example = 5;
val = "5";
example === val; //false; This line translates to "is the value of example equal to 10 the value of val, AND are the data types the same?"
example += val;
example === val;
Operator: !=
Examples:
example = 29;
val = 28;
example != val; //true; This line translates to "is the value of example not equal to the value of val?
example != val++;
example-- != val;
Operator: !==
Examples:
example = 10;
val = "10";
example !== val; //true; This line translates to "is the value of example not equal to the value of val, and is the data type of example also not the same as the data type of val?
val = 11;
val--;
example !== val;
Operator: >
Examples:
example = 300;
val = 295;
example > val; //true; This line translates to "is the value of example greater than the value of val?"
val * 5;
example > val; //false
example = 300 * 3 % val;
Operator: <
Examples:
example = 46;
val = 13;
example < val; //false; This line translates to "is the value of example less than the value of val?"
(example % val) < val; //true
(val % example) < example;
Operator: >=
Examples:
example = 50;
val = example;
example++ >= val;//true; This line translates to "is the value of example+1 greater than or equal to the value of val?"
example-- >= val++;
Operator: <=
Examples:
example = 20;
val = example*example;
example <= val;//true; This line translates to "is the value of example less than or equal to the value of val?"
example += val/2;
val <= example;
See the Pen Exercise 2.4 by LSU DDEM (@lsuddem) on CodePen.