Using prefix `o` in ui5 javascript Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Using prefix `o` in ui5 javascript without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I have seen people are using prefix o a lot when developing ui5 application.

var oRowsModel = new sap.ui.model.json.JSONModel();
   if (oValueHelpDialog.getTable().bindRows){


var oSelectedItem = oEvent.getParameter("selectedItem"),
            oTimeline = this.getView().byId("ActivityTimeline"),
            oTimelineBinding = oTimeline.getBinding("content");

Does it help somehow ? Is it a best practice ? What is the advantage?

I think that a lot of things are objects and specifying o does not help much. Why then to use it?


The prefixing of variables is just a naming convention carried over from the native SAP programming language called ABAP. In ABAP it is a long standing convention to prefix variables so that one can tell the type of the variable and if the variable is local or global, for instance lv_myvar for a local variable, and gt_mytab for a table type that is global. There is really no particular reason to continue with this practice in Javascript and UI5 – if you don´t like, don´t do it.

We are here to answer your question about Using prefix `o` in ui5 javascript - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji