Consider using arrow functions for callbacks JS-0241
Anti-pattern
Minor
5 months agoa year old
Unexpected function expression
 47/* This is an example for calling this function:
 48signOut(); */
 49export async function signOut() {
 50  document.cookie.split(";").forEach(function (c) { 51    document.cookie = c 52      .replace(/^ +/, "") 53      .replace(/=.*/, "=;expires=" + new Date().toUTCString() + ";path=/"); // Sets every cookie as expired to delete them 54  }); 55  await goto("/");
 56  location.reload();
 57}
Unexpected function expression
  3/* This is an example for calling this function: getCookie('cookieName'); */
  4export function getCookie(cookieName) {
  5  const cookie = {};
  6  document.cookie.split(";").forEach(function (el) {  7    const [key, value] = el.split("=");  8    cookie[key.trim()] = value;  9  }); 10  return cookie[cookieName];
 11}
 12