Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JSON.stringify on Arrays adding numeric keys for each array value

var kbInfo = [{ "questionId": "1", "customQuestion": "What is your first car make and model", "answer": "Ford Pinto" },{ "questionId": "14", "customQuestion": "Your favorite sports", "answer": "Sleeping" } ];

var wrapped = { SQA: kbInfo };

console.log(JSON.stringify(wrapped));
 
PREVIOUS NEXT
Tagged: #Arrays #adding #numeric #keys #array
ADD COMMENT
Topic
Name
2+2 =