function findUpper(text) {
let arr = [];
if (text.length === 0) {
return arr;
}
if (text.charAt(0) === text[0].toUpperCase()) {
arr.push(text[0]);
}
arr = arr.concat(findUpper(text.slice(1)));
console.log(arr);
return arr;
}
findUpper("i am a Web developer Student");
The desired output is "W", since it is the first upper case letter, But I cannot figure out how to print out that result.