Something messed up with codepen today or maybe just my browser (Firefox Dev edition) but here is the function to capitalize the 1st letter of a word in a string.
Join 7000+ other code newbies
Last year 7000 newbies learned how to code with me! Totally project oriented.
Subscribe and you'll get access to my classes, coupon codes for tech conferences and totally valuable article on jump-starting your career as a developer.