Replace Array Element With Another Javascript Substring Indexof