Adding Array Items Javascript Substring Vs Slice