I have a type variable
var column = $(this).attr('class');
Then I need to add this variable as the name of the JSON object, for example:
obj.push({ column : anotherVar });
This outputs a "column" instead of my variable. Which is the easiest way to convert my variable to a useful string in JSON.
source
share