SyntaxFix
Write A Post
Hire A Developer
Questions
Could you do the following:
obj = { "1":"aa", "2":"bb" }; var newNum = "3"; var newVal = "cc"; obj[newNum] = newVal; alert(obj["3"]); // this would alert 'cc'