)
}
}
)
(
}
{
)
)
(
)
(
(
{
}
)
(
)
}
)
)
{
(
(
)
)
}
)
(
}

Quick Random Value

  1. console.log(
  2.   ['x', 'y', 'z'][Math.floor(Math.random() * 3)]
  3. );

This will output either x, y or z. It works by looking up a random index of an inline array. I find this great for quick prototyping – probably not something you want to be using outside throw away code… Hit the “Try it out…” button and open your dev console.

snippet.zone ~ 2021-22 /// {s/z}