JavaScript responsive menu (dropdown/dropup)
General feedback
Overall it seems somewhat simple and works fine except for the issue I saw you mentioned in a comment on the accepted answer to the related Stack Overflow post, about having to click the menu button twice after resizing it that is caused by a conflict with page builder as explained in question update above.
One thing to consider is getting rid of the variable isMenuVisible - just check the value of menu.style.display when updating the visibility of the menu.
Suggestions
const vs let
I would use const for any value that should not get re-assigned - e.g. menu, burger. That way if you inadvertently re-assign a value to those, an error will be thrown.
Identifying the element used to open the menu
If there really is only one element for opening the menu, why not use an id attribute to find that instead of a class name.
Querying DOM for elements
Using document.getElementById() to access those DOM elements will be quicker1 than using document.querySelector().
Variable clicks
The variable clicks doesn't appear to be used - just set to 0 initially and then updated during the resize event callback. Is that leftover from other code? Or does it control something else in your code?
simpler and shorter patterns
As far as shortcuts using ecmascript-6 features, the only things I could think of would be to remove the block on mobileBehavior (to make it a single line) and using a single argument with only one character (e.g. named something like _) for the arrow functions instead of an empty set of parentheses (though that only saves character for each function).
Method mobileBehavior() and the resize event callback
Since mobileBehavior() is only called once, that functionality could just be moved to the place it is called... Then it doesn't really make sense to have that function. Perhaps it would be suitable to define a function like setDisplayBasedOnWidth, which contains most of the functionality of the resize callback (except setting the display to none when the width is less than the threshold). Then that function can be called initially, as well as after a resize event.
See the updated code below for slight improvements adapted.


document.addEventListener('DOMContentLoaded', _ =&gt; {
  const menu = document.getElementById('menu-primary');
  const burger = document.getElementById('burger');

  burger.addEventListener('click', _ =&gt; {
    const currentDisplay = menu.style.display;
    menu.style.display = currentDisplay == 'none' ? 'block' : 'none';
  });
  const setDisplayBasedOnWidth = _ =&gt; menu.style.display = window.innerWidth &lt;= 959 ? 'none' : 'block';

  window.addEventListener('resize', setDisplayBasedOnWidth);
  setDisplayBasedOnWidth();
});
:root {
  --w: #00ff00;
}

#burger {
  display: block;
  text-align: center;
  color: var(--w);
  margin-bottom: 0 !important;
  font-weight: bold
}

#menu-primary {
  display: none
}

@media screen and (min-width: 796px) {
  .burger {
    display: none
  }
  #menu-primary {
    display: block
  }
}
&lt;div id="burger"&gt;BARS&lt;/div&gt;

&lt;ul id="menu-primary"&gt;
  &lt;li&gt;Homepage&lt;/li&gt;
  &lt;li&gt;Contact_us&lt;/li&gt;
&lt;/ul&gt;