by japrescott · 14y ago · 0 comments
function(){ var fn2=function(){} if (fn2()){ alert("nobody ever calls me"); } else{ alert("stop calling me!"); } } (no return value is a falsy value)
var data={a:"cow"}; function update(obj){ obj.a="fish"; } update(data); alert(data.a); //"fish"
vs.
var data="cow"; function update(str){ str="fish"; } update(data); alert(data); //"cow"
keep up the great work!
No comments yet.