Convert Array Values Javascript Substring Method