How does js get the method name

window.__hello("copyLink", {
    params: {
        str: "hello word"
    },
    callback: window.__copyLinkResponse = function(r) => {
        console.log(r)
    }
    
})
window.__hello = function(methodName, data) {
    // data.callback   __copyLinkResponse ??
    
    
}

what syntax is this

function(r) => {
    console.log(r)
}

Function you can get the method name via Function.name .
if it is an anonymous function, there is no name

.
Menu