title: JavaScript throws the following error: SyntaxError: missing } in compound statement
body: <p>The following code block throws the error in Mozilla Firefox: SyntaxError: missing } in compound statement. Can anyone tell me where this } is missing and what I am doing wrong here? </p>
  
  <p>Edit: You can inspect element at <a href="https://burrim.github.io/recordsblog/" rel="nofollow noreferrer">https://burrim.github.io/recordsblog/</a> to see that error. The Script is the fourth, located in the head.</p>
  
  <p>Many Thanks!</p>
  
  <pre><code>function OpenCloseNav() {
  "use strict";
  var mq = window.matchMedia("(min-width: 50em)");
  var x = document.getElementById("_sidebar");
  var y = document.getElementById("_main");
  var z = document.getElementById("_menu");
  if (mq.matches) {
      // window width is at least 50em
          if (x.style.width === "0rem") {
          y.style.marginLeft = "22rem";
          y.style.marginRight = "4rem";
          x.style.width = "18rem";
          x.style.marginLeft = "0rem";
          z.style.left = "16rem";
      } else {
          y.style.marginLeft = "10.5rem";
          y.style.marginRight = "9.5rem";
          x.style.width = "0rem";
          z.style.left = "0.25rem";
     }
    } 
  }
  </code></pre>