/**
* @param {string[]} operations
* @return {number}
*/
var finalValueAfterOperations = function(operations) {
return operations.reduce( (output, operation) => {
return (operation === 'X++' || operation === '++X') ? output+1 : output-1
}, 0)
};