I would like to use the same function in XPages via Javascript.
Dim firstList List As Double
Dim secondList List As Double
firstList("any")= 0
firstList("many")= 2
firstList("work")= 23
Any suggestion is appreciated.
Regards
Cumhur Ata
I would like to use the same function in XPages via Javascript.
Dim firstList List As Double
Dim secondList List As Double
firstList("any")= 0
firstList("many")= 2
firstList("work")= 23
Any suggestion is appreciated.
Regards
Cumhur Ata
Use a JavaScript object:
Initialize object with
var firstList = {any:0, many:2, work:23};
or
var firstList = {};
firstList.any = 0;
firstList.many = 2;
firstList["work"] = 23;
Get an entry value with
var anyNumber = firstList.any;
var manyNumber = firstList["many"];
If you want to do this in server-side JavaScript you can use a HashMap and do something like this:
var firstList = new java.util.HashMap();
firstList.put("any", 0 );
firstList.put("many", 2);
firstList.put("work", 23);
You can then use firstList.get(key) to get the value.