I am trying to create a variable name based on id value of another variable. I thought this would work.
So when I click one of the 4 tables, I obtain the tables id. Example: 676.
I am then trying to create a variable using such number
var id = 66;
var 'table' + id = ''; // expecting var table66 = '';
I get error above. but if I try
var table66 = '';
it works No matter how I try adding "cans" + "66" equal to a new selector variable it will not work.
I am trying to achieve getting the id and a string. add them together to create a new variable name