Hi,
while testing Cloudscript, I found some strange thing.
from the code below, it seems line #9 was run before line #8
handlers.TestSequence = function (args, context) { var testvar = {"TEST":[ {"AA":1}, {"AA":2}, {"AA":3} ]}; log.debug("before push", testvar); testvar.TEST.push({"AA":4}); log.debug("after push", testvar); }
when I run this, I got this log
"Logs": [ { "Level": "Debug", "Message": "before push", "Data": { "TEST": [ { "AA": 1 }, { "AA": 2 }, { "AA": 3 }, { "AA": 4 } ] } }, { "Level": "Debug", "Message": "after push", "Data": { "TEST": [ { "AA": 1 }, { "AA": 2 }, { "AA": 3 }, { "AA": 4 } ] } } ],
I wonder why {"AA": 4} was already added the variable before the code reach line #9?
is it because log command will execute after all line of code?
thanks in advance & best regards,
Bodin