Lodash - gt 方法

语法

_.gt(value, other)

检查 value 是否大于 other。

参数

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

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

输出

  • (boolean) −如果值大于其他,则返回 true,否则返回 false。

示例

var _ = require('lodash');

console.log(_.gt(3, 1));
console.log(_.gt(1, 3));

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

命令

\>node tester.js

输出

true
false

lodash_lang.html