문제 링크 : Largest Odd Number in String
/** * @param {string} num * @return {string} */ var largestOddNumber = function(num) { for(let i=num.length-1; i>-1; i--) { if(+num[i] % 2 === 1) return num.slice(0, i+1) } return '' };