this.initialize.apply(this, arguments)
It works as follows:
this.initialize(arguments[0], arguments[1], arguments[2], ...)
Each element in the arguments is passed as a parameter initialize()
This is very different from just:
this.initialize(arguments)
Pass argumentsas the first and only parameterinitialize()
In other words, if the function expects the array to be the first parameter, use this.initialize(arguments), otherwise use .apply().
source
share