문제 링크 : Furthest Point From Origin
/**
* @param {string} moves
* @return {number}
*/
var furthestDistanceFromOrigin = function(moves) {
let move = 0
let any = 0
for(let el of moves) {
if(el === 'R') {
move++
}else if(el === 'L') {
move--
}else{
any ++
}
}
return Math.abs(move)+any
};