A common utility for JavaScript