
words 순회true 반환"") 반환function firstPalindrome(words: string[]): string {
for(const word of words) {
if(isPalindrome(word)) return word
}
return ""
};
function isPalindrome(word: string) {
for(let i = 0; i < Math.floor(word.length / 2); i++) {
const forward = word[i]
const backward = word.at(-(i + 1))
if(forward !== backward) return false
}
return true
}