Powershell String Replace Method Javascript Array Functions