Lodash - multiply 方法



語法

_.multiply(multiplier, multiplicand)

將兩個數字相乘。

引數

  • 乘數 (數字) − 乘法中的第一個數字。

  • 因數 (數字) − 乘法中的第二個數字。

輸出

  • (數字) − 返回乘積。

示例

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

console.log(result);

將以上程式儲存在 tester.js 中。執行以下命令來執行此程式。

命令

\>node tester.js

輸出

10
lodash_math.htm
廣告
© . All rights reserved.