callee property of arguments


We can know or call it self ago by the "arguments.callee" property of function.

Demo1:

Source:

function calleeLengthDemo(arg1, arg2) {
    if (arguments.length==arguments.callee.length) {
        window.alert("The length of the passed parameters is correct!");
        return;
    } else {
	s = "The length of the real passed parameters is "+arguments.length;
	s += "\nThe length of the formal parameters is "+arguments.callee.length;
	alert(s);
    }
}

calleeLengthDemo();

Result:


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章