I have stored a string in an array and want to check for white spaces that also stored in array. So that I can capitalize the each following word.
var arr = [];
arr = str.split("");
for(var i = 0; i < arr.length; i++) {
if(arr[i] === ' ') {
arr[i + 1].toUpperCase();
}
}