Using Reduce Method Javascript Substring Until Character Hub