if we pass string in a function parameters than how function arguments works with object key avlue in javascript code example
Example 1: javascript multiply arguments
const mul = (...args) => args.reduce((a, b) => a * b);
// Example
mul(1, 2, 3, 4); // 24
Example 2: how to access any argument in javascript
function example() {
console.log(arguments);
console.log(arguments[0]);
} // Console outputs an array of each argument with its value
example('hi', 'hello');
// Outputs:
// ['hi', 'hello']
// 'hi'