```
function evalRPN(tokens) {
const ops = {
'+': (a, b) => b + a,
'-': (a, b) => b - a,
'*': (a, b) => b * a,
'/': (a, b) => parseInt(b / a),
};
const stack = [];
tokens.forEach(t => stack.push(ops[t] ? ops[t](stack.pop(), stack.pop()) : parseInt(t)));
return stack.pop();
}
```