Hi i have a variable like below,
const str = 'passed'
now i want to capitalize only the first letter of the string. i can do it like below
const str2 = str.charAt(0).toUpperCase() + str.slice(1);
but is there any other better way to do the same using javascript?
could someone help me with this. thanks.