structUpdate

Updates a key with a value.

structUpdate(structure, key, value) → returns boolean

structUpdate Argument Reference

structure struct
Required

Structure to update

key string
Required

Key, the value of which to update

value any
Required

New value

Examples sample code invoking the structUpdate function

Change value of structure item

myStruct = {a: 1, b: 2, c: 3, d: 4};
structUpdate(myStruct,'c',15);
writeDump(serializeJSON(myStruct));

Expected Result: {"A":1,"B":2,"C":15,"D":4}


Fork me on GitHub