javascript relational operators code example
Example 1: != javascript
// " != " in Javasacript means : not equal.
Example 2: javascript relational operators
var point = { x:1, y:1 }; // Define an object
var has_x_coord = "x" in point; // Evaluates to true
var has_y_coord = "y" in point; // Evaluates to true
var has_z_coord = "z" in point; // Evaluates to false; not a 3-D point
var ts = "toString" in point; // Inherited property; evaluates to true
Example 3: js !==
var x = 5;
// === equal value and equal type
// e.g. 1.
x === 5 returns true
// e.g. 2.
x === "5" returns false
// !== not equal value or not equal type
// e.g. 1.
x !== 5 returns false
// e.g. 2.
x !== "5" returns true
// e.g. 3.
x !== 8 returns true