javascript compare two numbers code example

Example 1: Javascript how to compare three numbers

function compare(num1, num2, num3) {
	if (num3 > num2 && num1 > num3) {
		return num1 + ' is the biggest number';
	} else if (num2 > num1 && num2 > num3) {
		return num2 + ' is the biggest number';
	} else {
		return num3 + ' is the biggest number';
	}
}
var results = compare(10, 20, 30);
console.log(results);

Example 2: equal to or more than javascript

//Equal to or more than
a >= b
//Equal to or less than
a <= b

Example 3: === javascript

// ===	means equal value and equal type
var x = 5

// true
x === 5

// false
x === "5"