Answer the question
In order to leave comments, you need to log in
How to return an anonymous function name for an event?
I want to attach a function to an event and call it at the same time. Usually they write something like this:
var f = function () {
if (window.location.hash) {
scrollBy(0, -150);
}
};
f();
window.addEventListener('hashchange', f);
window.addEventListener('hashchange', (function () {
if (window.location.hash) {
scrollBy(0, -150);
}
return 'this.имя'; //??
})());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question