What is the “apply()” function in SAPUI5

前端 未结 2 526
走了就别回头了
走了就别回头了 2021-01-25 05:21

I know this is a silly question but I have seen in a lot of places the below statement:

something.apply(this, arguments)

Can someone please exp

相关标签:
2条回答
  • 2021-01-25 05:37

    Many components are subclasses of other UI5 components. In SAPUI5, the apply method is usually used to call methods in the parent of a subclass. This is often done from methods that override their parents original methods, to make sure that e.g. variables in the parent class are still properly initialised.

    0 讨论(0)
  • 2021-01-25 05:39

    apply() is method of javascript Function.

    See the documentation of apply(). This a very good explanation.

    0 讨论(0)
提交回复
热议问题