C
Christopher Benson-Manica
Just to make sure I'm on the right track...
function getADate() {
return new Date();
}
function foo() {
var bar=getADate();
alert( bar );
}
This doesn't work as one might expect because the date constructed by
getADate() is destroyed once the function returns, meaning that bar
is a reference to a destroyed object when alert() is called. Is that
correct?
function getADate() {
return new Date();
}
function foo() {
var bar=getADate();
alert( bar );
}
This doesn't work as one might expect because the date constructed by
getADate() is destroyed once the function returns, meaning that bar
is a reference to a destroyed object when alert() is called. Is that
correct?