I want to output as a string from this code. I just checked its length but I could not output as a string again like-('joy', 'james';). I don't know where is my problem with the output string. please help to solve this problem. thank you.
function oddFriend(name) {
let oddFr = [];
for (let i = 0; i < name.length; i++) {
let frName = name[i].length;
console.log(frName);
if (frName % 2 != 0) {
oddFr.push(frName);
}
}
return oddFr;
}
console.log(oddFriend(["jon", "james", "robert", "george", "Leo", "joy"]));