Toggle Class Lesson

Hey so I was just doing the toggle class lesson and wondered why trying to chain the toggle class with the menu button wouldn’t work.
https://www.codecademy.com/courses/learn-jquery/lessons/jquery-style-methods/exercises/toggleclass

$(document).ready(() => { $('.login-button').on('click', () => { $('.login-form').show(); }); $('.menu-button').on('click', () => { $('.nav-menu').toggleClass('hide'); }).toggleClass('button-active'); });