Utility functions for Javascript.