knockout js replace observablearray code example Example: knockout replace observable array self.locations.replace(oldLocation, new location(value));