Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

How is JS in real world used?

How is JS used in production?

Do you do everything in OOP, or functional programming? I mean...

//Burger Menu Toggle
var burgerMenu = document.querySelector(".m-header-site__burger");
var animsition = document.querySelector('.animsition');

burgerMenu.addEventListener('click', function() {

    console.log("burgerMenu clicked");
    burgerMenu.classList.toggle("active");

    animsition.classList.toggle("show-nav");

}, false);

or better, imagine you are doing modals.

Ud do OOP for modal? Or the way I just did above?

I assume for nav it's ok, but for modals OOP is the way to go in the real world?