From f092cbbed3c91f931c31477576b4bf7889c9f7f1 Mon Sep 17 00:00:00 2001 From: simonsayscode Date: Tue, 6 Jan 2015 11:49:29 -0500 Subject: [PATCH] Update ANSWERS.md From the MDN article on delete (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete): ------------ delete is only effective on an object's properties. It has no effect on variable or function names. While sometimes mis-characterized as global variables, assignments that don't specify an object (e.g. x = 5) are actually property assignments on the global object. ------------ Updating the answers to properly reflect this. --- ANSWERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ANSWERS.md b/ANSWERS.md index 02c07c2..b5eddbd 100644 --- a/ANSWERS.md +++ b/ANSWERS.md @@ -435,7 +435,7 @@ Joking aside though, if you're a job applicant skimming these answers so that yo **Answer:** - Using `delete` will destroy variables and properties, making them `undefined` when you try to access them. Things that cannot be deleted include properties of objects created from a prototype (but you can delete properties of the prototype itself). Additionally, if you call `delete` on an item in an array, the array's `.length` is unaffected. + Using `delete` will destroy only properties of objects, making them `undefined` when you try to access them. Things that cannot be deleted include properties of objects created from a prototype (but you can delete properties of the prototype itself). Additionally, if you call `delete` on an item in an array, the array's `.length` is unaffected. Contrary to belief, using delete will not mark variables as 'undefined', and global variables are actually properties of the global object. ```js //