Using Reduce Method Javascript Substring Until Character Creator