Is there a way to define variables in javascript to append them with another variable?
var card_id;
var card_links_grid+card_id;
I’d like the second variable to be appended with the information found in the first variable. For each card_id there will be a card_links_grid. I want to be able to access the card_links_grid variable for a specific card_id.
What’s the right way to do that?
The right was is to use either an array or an object, depending on if the id is going to be sequential or named.
or
Variable variables are possible, but only with some hard to maintain and debug approaches that should be avoided. Use object types designed for the data structure you want to represent.