Hide Menu When Clicked Outside

I've written a code that hides my menu when clicked outside of the menu or the button. Do you think my code is good or it can be improved. New to Javascript.
https://codepen.io/Arslan-Akbar/pen/poOMadb
mobile_menu.PNG
Was this page helpful?