SyntaxFix
Write A Post
Hire A Developer
Questions
It does not matter where the variable comes from. Main thing we have one ... Set the variable name between square brackets "[ .. ]".
var optionName = 'nameA'; var JsonVar = { [optionName] : 'some value' }