Function product multiplies all numbers passed as standalone arguments and returns their product.
Remarks
The product function is mathematically defined as the multiplication of sequence of any kind of numbers
and in practise is very often used.
Usage of the function is heavily inspired by ECMAScript's native Math module functions,
like Math.min
and Math.max.
Therefore it takes optional amount of numerical arguments passed
and tries to efficiently proceed with computation of multiplication. Be aware that passing any
non-numerical argument may cause unexpected results, as JS internally tries to convert all arguments
into numbers. Therefore incorrectly formatted strings could cause returning NaN values.
Example
Simple usage of direct use of values or variables:
Function product multiplies all numbers passed as standalone arguments and returns their product.
Remarks
The product function is mathematically defined as the multiplication of sequence of any kind of numbers and in practise is very often used.
Usage of the function is heavily inspired by ECMAScript's native Math module functions, like Math.min and Math.max. Therefore it takes optional amount of numerical arguments passed and tries to efficiently proceed with computation of multiplication. Be aware that passing any non-numerical argument may cause unexpected results, as JS internally tries to convert all arguments into numbers. Therefore incorrectly formatted strings could cause returning
NaN
values.Example
Simple usage of direct use of values or variables:
Usage with already existing array of values: