Copy Values From One Array To Another Javascript Substring Replace