Little utilities in Javascript