Replace Array Element With Another Javascript Interview Programming