What is the “apply()” function in SAPUI5

前端 未结 2 558
走了就别回头了
走了就别回头了 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.

提交回复
热议问题