From 9ddbee6420d7c1bb31c09bd7c72c5118c55f9d62 Mon Sep 17 00:00:00 2001 From: Sakthipriyan Vairamani Date: Mon, 19 Nov 2018 19:36:51 +0530 Subject: [PATCH] emphasise delete is an operator not a function --- this & object prototypes/ch3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/this & object prototypes/ch3.md b/this & object prototypes/ch3.md index 8821d862e..7f7f0e5b7 100644 --- a/this & object prototypes/ch3.md +++ b/this & object prototypes/ch3.md @@ -485,7 +485,7 @@ delete myObject.a; myObject.a; // 2 ``` -As you can see, the last `delete` call failed (silently) because we made the `a` property non-configurable. +As you can see, the last `delete` operator failed (silently) because we made the `a` property non-configurable. `delete` is only used to remove object properties (which can be removed) directly from the object in question. If an object property is the last remaining *reference* to some object/function, and you `delete` it, that removes the reference and now that unreferenced object/function can be garbage collected. But, it is **not** proper to think of `delete` as a tool to free up allocated memory as it does in other languages (like C/C++). `delete` is just an object property removal operation -- nothing more.