Common JavaScript utils.