1
可能重複裏面的功能:
Can I get the name of the currently running function in javascript?
Get function name in javascript有什麼辦法,在JavaScript中,獲得函數的名稱,這是所謂
有什麼辦法,在JavaScript中,獲取函數的名稱,在被調用的函數內部。
function something() {
console.log("The name of the function you invoke is " ...should says 'something');
}
這同樣的問題在這裏回答:http://stackoverflow.com/questions/1013239/can-i-get-the-name-of-the-currently-running-function-in-javascript –