Aggregate by Operation

Aggregate by Operation

This is a further development of Convert and Aggregate mission. You are given an Array of tuples. Each tuple consists of two values: a string and a number. You need to create and return an Object, where keys are string values (except the first character) from input tuples. Values are aggregated number values from input tuples for each specific key. Each aggregating operation must be done according to the operation sign - the first character of string key. Division by zero should be ignored. The resulted Object should not include items with empty key or zero value.

Input: Array of tuples.

Output: Object.

Examples:

assert.deepStrictEqual(
    aggrOperation([
        ["+a", 7],
        ["-b", 8],
        ["*a", 10],
    ]),
    { a: 70, b: -8 }
);
assert.deepStrictEqual(aggrOperation([]),...
You should be an authorized user in order to see the full description and start solving this mission.