Python Find And Replace In Array Js Functions