jQuery // Set var to true/false in toggle function
===

(jQuery)

I have a button and I want my variable **click** to be set **= true** when the button is clicked and **= false** when the button is clicked again **(toggle)**. 

When **click = true** I want it to output _"clicked"_ into the console and when **click = false** I want it to output _"not clicked"_.

    var click = false

_and heres my **toggle function:**_

    $('.button').toggle(
        
        function(){
            click = true;
            $('.bmw').show();

        }, function() {
            click = false;
            $('.bmw').hide();

        });

_and what I want it to do:_

    if(click = true) {
	    console.log('clicked');
    } else {
        console.log('not clicked');
    }

When I load the page the console shows _"not clicked"_ but when I press the button it doesn't switch to **true**. The **bmw objects** _('.bmw')_ do however show and hide when I toggle the button so that seems to be working fine.

What am I doing wrong?