Example in a loop:
let `variable_${key}` = array[key][index];
Of course I tried this and it doesn't work, so I'm looking for some other way to achieve the same result.
I want to assign each value associated with a key, in the deepest objects of an object with arrays of objects to their own uniquely named respective variable, that includes the key name in the name.
This is because the number of deepest objects in each array varies, and each value from each object ends up as a line in a file, if that value exists, and doesn't otherwise.
The method I'm using now is to take the length of the largest array and add that number of variables manually to each loop, filling the empty ones with strings when the request from the item doesn't exist. It's a little hackish.
Has anyone contrived a cleaner method for this?