Both answers from Ibrahim Tanyalcin and Nicolás Parada are correct, but I thought I'd add onto them a bit. 😄
One way to achieve what you're trying to do in the browser environment is to wrap your module in an IIFE and then return what you want to expose to a variable attached to window.
For example,
let windowVariable = (function() {
let Menu = {};
return {
specialty: "Roasted Beet Burger with Mint Sauce",
getSpecialty: function() {
return this.specialty;
}
}
})();
This way, local variables to your module are wrapped inside a IIFE so that they don't leak out and the part that you want to expose to the outside environment is returned.