Reading through the Backbone.js source code, I saw this:
validObj[attr] = void 0;
What is void 0
? What is the purpose of using it here?
This question is related to
javascript
backbone.js
void
is a reserved JavaScript keyword. It evaluates the expression and always returns undefined
.
void 0
returns undefined and can not be overwritten while undefined
can be overwritten.
var undefined = "HAHA";
Source: Stackoverflow.com