How to capitalize first letter in JavaScript

Strings
Last updated Dec 16, 2017
let str = "welcome to code to go";

str = str.charAt(0).toUpperCase() + str.substr(1);
Welcome to code to go