Reduce Method In Javascript Array Length