How to create public and private members?

前端 未结 6 1836
小鲜肉
小鲜肉 2020-12-17 03:22

I\'m a bit confused, how can I create public and private members.

My code template so far is like:

(function()){
   var _blah = 1;

   someFunction =         


        
6条回答
  •  萌比男神i
    2020-12-17 03:41

    Javascript doesn't have true private members. You have to abuse scope if your really need privacy.

提交回复
热议问题