How To Know What The Function Parameters Are? - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.9
Category
Reference Guide

Usually, the documentation of each custom function indicates how many parameters the function takes and gives a short description of each of them. But their structure is not often detailed.

To know what a parameter contains, here are two solutions:

  • Use the console.log() JavaScript instruction like this:
    console.log(myParameter) ;
    It dumps the variable myParameter in the browser console.
  • Use a JavaScript debugger.

Once the object structure is known, it is possible to access it using the syntax described above. Let's assume the object to read is the following one:

var myObject = {
"simpleValue": "Foo",
"objectValue": {
"simpleValue": "Bar"
},
"arrayValue":["Value1", {"property": "Value2"}],
"aFunction": function()
};

Expression

Value

myObject.simpleValue

Foo

myObject['simpleValue']

Foo

var propertyName = 'simpleValue';

myObject[propertyName]

Foo

myObject.objectValue.simpleValue

Bar

myObject.arrayValue[0]

Value1

myObject.arrayValue[1].property

Value2

myObject.aFunction()

Calls the function