Skip to content

Conversation

@powy1993
Copy link

var swipe=(function(me){
var test = 1;
var undefined = 1;
// compare following situations:
me.test1 = (test !== undefined); //false
me.test2 = (typeof test !== 'undefine'); // true
return me;
}(swipe||{})
);
alert(swipe.test1);
alert(swipe.test2);

var swipe=(function(me){
   var test = 1;
   var undefined = 1;
// compare following situations:
   me.test1 = (test !== undefined);  //false
   me.test2 = (typeof test !== 'undefined');   // true
   return me;
   }(swipe||{})
);
alert(swipe.test1);
alert(swipe.test2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant