What is wrong here exactly? I'd like to append information to a variable.
Ive tried different approaches, and it usually comes down to the fact that it doesnt want me to variable.push(x) anything. It says push() isnt a function.
So I have the variable which is supposed to be a list with dicts. Id like to append a new dict to it.
And yes I know there are typos in that script, I've tried different approaches.
The clean version
// Create a new object (dict) to append
let newDict = { id: "testID", amount: 1 };
// Append the new object to the array
selected_items.push(newDict);
isnt working either
Working code:
// Create a new object (dict) to append
let newDict = { id: "testID", amount: 1 };
let oldDict = selected_items.value;
oldDict.push(newDict);
// Append the new object to the array
selected_items.setValue(oldDict);