Reducer Function In Javascript Example