From 6cc3894c245e092ea8b4764b9adb6991b6b24a6b Mon Sep 17 00:00:00 2001 From: Doma Date: Sat, 9 Jul 2022 22:54:38 +0800 Subject: [PATCH] Explain subtle difference between remove and delete action (#75) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 181d637..b0fedb7 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,14 @@ function deletePost(id) { > See also [remove](#remove). +> **`remove` or `delete`?** +> +> When the difference between `remove` and `delete` is not so obvious to you, I'd sugguest looking at their opposite actions - `add` and `create`. +> The key difference between `add` and `create` is that `add` needs a destination while `create` **requires no destination**. You `add` an item *to somewhere*, but you don't "`create` it *to somewhere*". +> Simply pair `remove` with `add` and `delete` with `create`. +> +> Explained in detail [here](https://github.com/kettanaito/naming-cheatsheet/issues/74#issue-1174942962). + ### `compose` Creates new data from the existing one. Mostly applicable to strings, objects, or functions.