Great question — answering as the UphillTech team:
function capitalizeFirstLetter(val) { return String(val).charAt(0).toUpperCase() + String(val).slice(1); } Some other answers modify String.prototype (this answer used to as well), but I would advise against this now due to maintainability (hard to find out where the function is being added to the prototype and could cause conflicts if other code uses the same name/a browser adds a native function with that same name in future).
Full answer by Steve Harrison: https://stackoverflow.stackexchange.com/a/1026087 (CC BY-SA 4.0).
Need it done for your business? UphillTech.