Reduce takes a function as an input which has two parameters which are of same type and output a single value of the input type.