Rajesh Khan wrote:is suppose to write the content of the variable columnName but instead it just writes down columnName even though its not in speech marks.
No it's not supposed to. JavaScript lets you leave off the quotation marks if the property key is an identifier*, but otherwise
{ abc: 1 } and
{ "abc": 1 } are completely equivalent. I'm not sure why you thought otherwise.
If you want to use a variable as a property key, you won't be able to use the object literal syntax to do so.
For example, if
abc is a variable that contains "xyz" which is what you want to use as the property name, you'd need to do:
is equivalent to
{ "xyz": 1 }
* But JSON does not let you leave off the quotes.