📜  javascript 函数长度 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:02.755000             🧑  作者: Mango

代码示例2
// The "function length" in JS evaluates to the number of it's params

const sum = (a, b) => a + b;
const log = (s) => console.log(s);
const noop = () => {};

console.log(sum.length);  // 2
console.log(log.length);  // 1
console.log(noop.length); // 0