I was trying to implement Component.js in my SAPUI5 application but unable to understand .extend & .prototype.init.apply method in below piece of code.
sap.ui.define([
"sap/ui/core/UIComponent"
], function (UIComponent) {
"use strict";
return UIComponent.extend(""** , {**
init: function () {
UIComponent.prototype.init.apply(this, arguments);
// console.log(UIComponent.extend);
UIComponent.prototype.init.apply(this, arguments);
}
});
});
Can someone please explain?
P.S. I am beginner to OO Javascript.