e) {
  if (localStorage.getItem("layout") === "horizontal") {
    localStorage.setItem("layout", "vertical");
  } else if (localStorage.getItem("layout") === "vertical") {
    localStorage.setItem("layout", "horizontal");
  } else if (!localStorage.getItem("layout")) {
    if (state === "horizontal") {
      localStorage.setItem("layout", "vertical");
    } else {
      localStorage.setItem("layout", "horizontal");
    }
  }

  console.log(localStorage.getItem("layout"));
}

    (function (window, document)