Lodash - multiply 方法

语法

_.multiply(multiplier, multiplicand)

将两个数字相乘。

参数

  • 乘数(数字) − 乘法中的第一个数字。

  • 乘数(数字) − 乘法中的第二个数字。

输出

  • (数字) − 返回乘积。

示例

var _ = require('lodash');
var result = _.multiply( 5, 2);

console.log(result);

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

命令

\>node tester.js

输出

10

lodash_math.html