Using Reduce Method Javascript Substring Negative Slope Intercept