freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../basic-javascript/comparison-with-the-greater.../index.md

21 lines
406 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Comparison with the Greater Than Operator
---
## Comparison with the Greater Than Operator
`>` (Greater Than) is a logical operator that returns true case the value on the left is higher than the one on the right.
## Basic Solution
```javascript
function testGreaterThan(val) {
if (val > 100)
return "Over 100";
if (val > 10)
return "Over 10";
return "10 or Under";
}
```