Javascript common utils