is there a way for me to pass a variable name as a string in a function?
For example, I am trying to initialize a datatable by using a function that passes in variables for the datatable's attributes. Without using a function, I would initialize the table by:
TabularTables.myTable = new Tabular.Table({
name: myTable
})
Instead, I want to initialize it with a function like:
function buildTable(tableName) = {
TabularTables.tableName = new Tabular.Table({
name: tableName
})
}
And call it as:
buildTable('coolTableName');
However, when I try this, I get the error 'Your table is missing attributes'.
Can someone help?
Thanks!