Q: Set boolean for a function inside a variable //     openMNav.isDropDown = false;
       var openMNav = function () {                         
              if (!this.isDropDown) {
              this.isDropDown = true;
              console.log(1);
            } else {    
              this.isDropDown = false;
              console.log(0);                          
        }

My question is how to do something like this: var openMNav.isDropDown = false;.
I want to set openMNav -> isDropDown outside the function to false

A: You mean to set on the function itself, you should just use openMNav in the function not this.
function openMNav () {

    if (!openMNav.isDropDown) {
        console.log('do open');
        openMNav.isDropDown = true;
    }
    else {
        console.log('already opened');
        openMNav.isDropDown = false;
    }
}

openMNav();
openMNav();

