How to capitalize the first letter in a string with JavaScript

1 Answer

0 votes
let s = "javascript programming";

s = s.charAt(0).toUpperCase() + s.slice(1);

console.log(s); 


  
    
    
/*
run:
    
"Javascript programming"
    
*/

 



answered Jan 25, 2021 by avibootz
...