光辉飞翔

导航

 

which of the following is used to solve the problem of enumerations in JavaScript? ------Generators

 

  //写法1:
  var ShareType = ...{OnlyMe : 0

                          ,IAndFriend : 1

                          ,All : 2
                          };


    //写法2:
  var ShareType = ...{};
    ShareType.OnlyMe = 0;

    ShareType.IAndFriend = 1;
    ShareType.All = 2;

posted on 2012-11-15 10:04  光辉飞翔  阅读(4407)  评论(0编辑  收藏  举报