what is the difference between void 0
and undefined
in the following contexts?
function Test(value) {
if(value === void 0) {
value = 123;
}
this.value = value;
}
function Test(value) {
if(value === undefined) {
value = 123;
}
this.value = value;
}
function Test(value) {
this.value = value || 123;
}
AFAIK, all three produce the same result.
undefined === void 0
// true
Thus, what is the difference between undefined
and void 0
, and what benefit does one have over the other?