In Javascript, how can one determine the number of formal parameters defined for a function?
Note, this is not the arguments
parameter when the function is called, but the number of named arguments the function was defined with.
function zero() {
// Should return 0
}
function one(x) {
// Should return 1
}
function two(x, y) {
// Should return 2
}
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…