Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onnodige variable #5

Open
MelvinIdema opened this issue Feb 21, 2023 · 0 comments
Open

Onnodige variable #5

MelvinIdema opened this issue Feb 21, 2023 · 0 comments

Comments

@MelvinIdema
Copy link

De laatste 3 variables in je code zijn onnodig. Probeer of de eventListener toe te voegen aan je variable:

const homeButton = document.querySelector('footer > button:first-of-type');
homeButton.addEventListener("click", () => {
    window.location.hash = '#home';
})

Of haal de variable weg:

document.querySelector('footer > button:first-of-type').addEventListener('click', () => { /* Go to profile page */
    window.location.hash = '#home';
})

var homeButton = document.querySelector('footer > button:first-of-type').addEventListener('click', () => { /* Go to profile page */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant