freeCodeCamp/guide/chinese/certifications/javascript-algorithms-and-d.../basic-javascript/comparison-with-the-less-th.../index.md

22 lines
407 B
Markdown
Raw Normal View History

---
title: Comparison with the Less Than Operator
localeTitle: 与小于算子的比较
---
## 与小于算子的比较
**`<`** Less Than是一个逻辑运算符它返回true左边的值低于右边的值。
## 基本解决方案
```javascript
function testLessThan(val) {
if (val < 25)
return "Under 25";
if (val < 55)
return "Under 55";
return "55 or Over";
}
```