I need to create a function name DBReport to a fila name sonic.js.. the arguments are (layerNo, tableID, itemID, type, keyValue) to output a record. So I did it like this, not sure if this is the right format.

WRITTEN ON MY SPECS: sonic.js file to add a new method. To format as well as the definition of an existing API. (Overview, arguments, return values, remarks, property description comments) Add a DBReport method (record)

Summary: Output to record.

swi.CreateDBReport = function (layerNo, tableID, itemID, type, keyValue ) {
int layerNo = swi.CreateDBReport(layerNo);
var tableID = swi.CreateDBReport(tableID).value;
int itemID = swi.CreateDBReport(itemID);
int type = swi.CreateDBReport(type);
var keyValue = swi.CreateDBReport(keyValue).value;
}

I need to call the same method to a different file name app.js but this time, I need to define the arguments. I did it like below.

SECOND: app.js
Call the DBReport method of the appmain.js file. Use in the argument when calling the arguments passed to this method

Example : gisapp.createDBReport(layreNo, tableID, itemID, type, keyValue)

this.DBReport = function (layerNo, tableID, itemID, type, keyValue ) {

this.define(layerNo, tableID, itemID, type, keyValue);
},
define: function(){
int layerNo;
var tableID = "";
int itemID;
int type;
var keyValue = "";
}

layerNo - integer
tableId - string
itemID - integer
type - integer
keyValue - string

Sorry if my question seems confusing.. I have 2 files.. app.js and sonic.js.. this function is to output a record of data.. I don't have any idea about javascript because this is really the first time I'm goint to use javascript.