JavaScript utils.