Some small js utilities