Using some cool binary operands, you could also do something like:
const capitalizeFirstLetter = (str) => str ? String.fromCharCode(str.charCodeAt(0) & ~32) + str.slice(1) : '';
But this seems excessive.