diff --git a/README.md b/README.md index 7045b0be..733b70fa 100644 --- a/README.md +++ b/README.md @@ -190,10 +190,10 @@ To delete or update an item you can use the `.key` property of a given object. B }, updateItem: function (item) { // create a copy of the item - item = {...item} + const copy = {...item} // remove the .key attribute - delete item['.key'] - this.$firebaseRefs.items.child(item['.key']).set(item) + delete copy['.key'] + this.$firebaseRefs.items.child(item['.key']).set(copy) } ```