Accessing JS Private Methods

前端 未结 2 1666
渐次进展
渐次进展 2020-12-22 10:48

I am working on trying to make an JS object and access to private methods. The problem I am running into when trying to return a function is the private methods cannot be ac

2条回答
  •  旧巷少年郎
    2020-12-22 11:14

    Fixed your code here: http://jsfiddle.net/pratik136/JryAk/

    Items changed:

    • Check your return statement
    • Item is a var, you were trying to instantiate a class object item2

提交回复
热议问题