Lodash - lt 方法

语法

_.lt(value, other)

检查 value 是否小于 other。

参数

  • value (*) − 要比较的值。

  • other (*) − 要比较的其他值。

输出

  • (boolean) − 如果 value 小于 other,则返回 true,否则返回 false。

示例

var _ = require('lodash');

console.log(_.lt(1,2));
console.log(_.lt(2,1));

将上述程序保存在tester.js中。运行以下命令执行该程序。

命令

\>node tester.js

输出

true
false

lodash_lang.html