The length of function depends on how many parameters it has.
<script>
function a(){
//doSomething
}
console.log(a.length); //0
function b(a){
//doSomething
}
console.log(b.length); //1
function c(a,b){
//doSomething
}
console.log(c.length); //2
</script>