title: Hide bootstrap hamburger icon when no nav-items exists
body: <p>I'm populating nav-tems inside navbar bootstrap component dynamically and there are times when there are no nav-items in which case I want to hide the hamburger icon in device viewports.
  I figured <code>navbar-toggler-icon</code> is the class responsible for this.
  Removing this class when there are no <code>nav-items</code> causes a bordered box to appear.</p>
  
  <p>What would be the approach to hide the hamburger element when there are no nav-items?</p>
  
  <p><a href="https://codepen.io/SubSul/pen/OKyVzX?editors=1000" rel="nofollow noreferrer"><strong>Codeply</strong></a> of navbar's with nav-items and without nav-items.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;nav class="navbar navbar-expand-lg navbar-light bg-light"&gt;
  
      &lt;a class="navbar-brand" href="#"&gt;Navbar Without Nav Items&lt;/a&gt;
  
      &lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav2" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"&gt;
          &lt;span class="navbar-toggler-icon"&gt;&lt;/span&gt;
      &lt;/button&gt;
  
      &lt;div class="collapse navbar-collapse" id="navbarNav2"&gt;
          &lt;ul class="navbar-nav"&gt;&lt;/ul&gt;
      &lt;/div&gt;
  
  &lt;/nav&gt;</code></pre>
  </div>
  </div>
  </p>