While following Airbnb's style guide, I encountered an issue with a couple of functions that reference each other. This error occurs regardless of the order in which the functions are defined. Are there any best practices for resolving this error other than simply disabling it?
function foo() {
const ham = document.querySelector('#ham');
ham.onclick = () => {
bar();
};
}
function bar() {
const spam = document.querySelector('#spam');
spam.onclick = () => {
foo();
};
}