Use Of Reduce Function In Javascript With Parameters