1

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 explain me the use of this function or point me to some kind of documentation?

hirse
  • 2,394
  • 1
  • 22
  • 24
Deepak
  • 505
  • 1
  • 9
  • 32

2 Answers2

2

apply() is method of javascript Function.

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

Haojie
  • 5,665
  • 1
  • 15
  • 14
1

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.

jpenninkhof
  • 1,920
  • 1
  • 11
  • 12