Is there a event listener for function calls or creation or assignment of variables(global and local) without any Javascript library(if possible). I the following code
window.addEventListener("function" /*Just need to know the right event name*/, function() {
console.log("called: " + event.name);
console.log("arguments: " + event.arguments.length);
});
let v1 = "unset";
function test(x,y) {
var v2 = y;
v1 = "console ";
console.log(v1 + v2 + x);
}
test("1234","test ");
The console output should be "console test 1234" "name: test" & "arguments: 2"
I've checked so many sites for a list of all JS event listenters, but have always found quite a few undocumented.