>
) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns true
. Otherwise, it returns false
.
Like the equality operator, greater than operator will convert data types of values while comparing.
Examples
5 > 3 // true
7 > '3' // true
2 > 3 // false
'1' > 9 // false
greater than
operator to the indicated lines so that the return statements make sense.
testGreaterThan(0)
should return "10 or Under"
testString: assert(testGreaterThan(0) === "10 or Under", 'testGreaterThan(0)
should return "10 or Under"');
- text: testGreaterThan(10)
should return "10 or Under"
testString: assert(testGreaterThan(10) === "10 or Under", 'testGreaterThan(10)
should return "10 or Under"');
- text: testGreaterThan(11)
should return "Over 10"
testString: assert(testGreaterThan(11) === "Over 10", 'testGreaterThan(11)
should return "Over 10"');
- text: testGreaterThan(99)
should return "Over 10"
testString: assert(testGreaterThan(99) === "Over 10", 'testGreaterThan(99)
should return "Over 10"');
- text: testGreaterThan(100)
should return "Over 10"
testString: assert(testGreaterThan(100) === "Over 10", 'testGreaterThan(100)
should return "Over 10"');
- text: testGreaterThan(101)
should return "Over 100"
testString: assert(testGreaterThan(101) === "Over 100", 'testGreaterThan(101)
should return "Over 100"');
- text: testGreaterThan(150)
should return "Over 100"
testString: assert(testGreaterThan(150) === "Over 100", 'testGreaterThan(150)
should return "Over 100"');
- text: You should use the >
operator at least twice
testString: assert(code.match(/val\s*>\s*('|")*\d+('|")*/g).length > 1, 'You should use the >
operator at least twice');
```