Create a function that when given the following input:
[
{
a: [ 1, 2, 3, 4, 5 ]
},
{
a: [ 1, 2, 3, 4 ]
},
{
a: []
},
{
b: [ 5, 4, 3, 2, 1 ]
},
{
b: [ 5, 4, 3, 2 ]
},
{
b: [ 0 ]
}
]
Produces the following output:
{
a: 25,
b: 29
}
Implement the following functions:
const addOneAndDouble = compose(addTwo, double, addOne)
So that when the following is called:
addOneAndDouble(12)
It produces the result of 28
Create 2 custom implementations of the filter method.
so that the following expression:
filter(x => x != 'a')(['a', 'b', 'c', 'd'])
produces the following result:
['b', 'c', 'd']