A small JavaScript utility