Simple question, but I'm interested in the nuances here.
I'm generating random booleans using the following method I came up with myself:
const rand = Boolean(Math.round(Math.random()));
Technically, the code looks fine, but just a bit too complex. You can compare "Math.random()" to "0.5" directly, as the range of Math.random() is [0, 1). You can divide the range into [0, 0.5) and [0.5, 1).
var random_boolean = Math.random() >= 0.5;