forked from extern/naming-cheatsheet
Explain subtle difference between remove and delete action (#75)
This commit is contained in:
parent
b392481dae
commit
6cc3894c24
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user