hey mec quelqu'un peut me aider à réparer mon code afin qu'il ne la tâche indiqué dans le texte,majuscule la première lettre de chaque mot dans une phrase
function tad(strg) {
var char = strg.split('-')
for (var i = 1; i < char.length; i++) {
return char[i].charAt(0).toUpperCase() + char[i].slice(1)
}
}
camelize("background-color") == 'backgroundColor'
camelize("list-style-image") == 'listStyleImage'
Votre première fonction retourne réellement "BackgroundColor" pour "background-color" – yantrakaar
de @yantrakaar: Oh, non, je ne l'ai pas remarqué l'OP voulait que le premier mot * * différemment. Fixé maintenant – Bergi