Dot case a string in JavaScript