Get Array Input Value Javascript Substring Syntax