Magic Methods in JavaScript [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-21 07:26:15

问题


Are the any magic(al) methods under JavaScript?

I'm explicitly interested in setters, getters and callables (functions/methods), like those we have in PHP: __set, __get and __call && __callStatic.

I was googling and searching StackOverflow, but no results.

Please, if anyone is informed - THANKS!


回答1:


see this:

JavaScript's equivalent to PHP's __get() magic method

JavaScript getter for all properties



来源:https://stackoverflow.com/questions/6303896/magic-methods-in-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!