• + 0 comments

    Hi, I'm using this: function getMax(operations) { const operationsToDo = operations.slice(1); let result = []; let temp = [];

    for (let op of operationsToDo) {
        const [operation, value] = op.split(' ').map(Number);
        if(operation === 1){
            temp.push(value);
        } else if(operation === 2){
            temp.pop();
        } else if(operation === 3 && temp.length > 0) {
            result.push(Math.max(...temp));
        }
    };   
    
    return result;
    

    I get an error, do you know why }?