匿名函数

var myApplication = function(){

  var name = 'Chris';

  var age = '34';

  var status = 'single';

  function createMember(){

    // [...]

  }

  function getMemberDetails(){

    // [...]

  }

  return{

    create:createMember, get:getMemberDetails

  }

}();

//myApplication.get() and myApplication.create() now work.

 

posted @ 2015-07-16 11:28  darr  阅读(120)  评论(0编辑  收藏  举报