How to change string case of object attribute in JavaScript
<p>Let's say that I have an object called "animal" and it has an attribute called "type".</p>

<p>By default animal.type returns string values such as "dog" or "CAT". I would like to turn those strings into something like "Dog" or "Cat" with only the first letter being uppercase. There are only alphabetic characters in the string so there will not be spaces, numbers or special characters.</p>

<p>What are some efficient ways to do that in JavaScript?</p>