caller是函数的一个方法,它指向调用该函数的函数

function a(){
    console.log(a.caller)  
}
function b(){
    a()
}
b()

输出:
ƒ b(){
    a()
}

callee是arguments的一个属性,他指向arguments的函数

function a(){
    console.log(arguments.callee)
}
function b(){
    a()
}
b()

输出:
ƒ a(){
    console.log(arguments.callee)
}

 

相关文章: