Tell us what’s happening:
Hello!
I dont understand why the FreeCodeCamp’s system doesnt want to accept my task? I think the code works and fullfills the requirements. Maybe im wrong?
function titleCase(str) {
var arr = str.split(" ");
for (var i = 0; i < arr.length; i++){
arr[i] = arr[i].split("");
for (var x = 0; x < 1; x++){
arr[i][x] = arr[i][x].toUpperCase();
}
for (var y = 1; y <arr[i].length; y++){
arr[i][y] = arr[i][y].toLowerCase();
}
arr[i] = arr[i].join("");
}
str = arr.join(" ");
return str;
}
```
**Link to the challenge:**
https://www.freecodecamp.org/challenges/title-case-a-sentence