Hello, has anyone encountered something like this....
# suitescript
i
Hello, has anyone encountered something like this. I have a have an array that has 4 items, then that variable I set it to a key in an object, but for some reason that I can’t understand, when I print the variable that Im going to be set, it has 4 items, and I expect that those 4 items to be on the object’s key, but when printing the object, that variable has 6 items, it has repeated the last one 2 times!How could this be possible. Im doing this test on chromes console, because this issue appeared in production and wanted to test it
s
Maybe there's some code that is mutating that array between when you printed the original and when it rendered the 6?
Also, I think chrome defers calculating the array for display until the moment you click the expansion triangle next to the variable name.
so, if anything changed the array before you clicked that, it's a possibility.
another possibility is something else reassigned that property (with a new array of 6)
note also that you're not cloning the array, so I think if the
newSublist
variable gets modified it will reflect on your object as well - since they are the same reference.