How Reduce Works In Javascript