const sections = document.querySelectorAll("section");
const navLi = document.querySelectorAll("nav .container ul li");
window.addEventListener("scroll", () => {
let current = "";<br>
sections.forEach((section) => {
const sectionTop = section.offsetTop;
const sectionHeight = section.clientHeight;<br>
if (pageYOffset >= sectionTop - sectionHeight / 3) {<br>
current = section.getAttribute("id");
}
});
navLi.forEach((li) => {
li.classList.remove("active");
showing error- Unexpected use of 'pageYOffset' no-restricted-globals,. Is there any solution for this?