evalRPN = function(tokens, index = 0) {
    while (1 < tokens.length) {/* Time O(N) */
        const isOperation = () => tokens[index] in OPERATORS;
        while (!isOperation()) index++;/* Time O(N) */

        const value = performOperation(tokens, index);

        tokens[index] = value;
        tokens.splice((index - 2), 2);/* Time O(N) */
        index--;
    }

    return tokens[0];
}
https://leetcode.com/problems/evaluate-reverse-polish-notation
Time O(N^2) | Space(1)
@param {string[]} tokens
@return {number}