Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert object array to json javascript

var JsonObject, jsArray;

// JS array
jsArray = ["one", "two", "three"];

// Convert (js array) to (json object)
JsonObject = JSON.parse(JSON.stringify(jsArray));

// type
console.log(typeof(JsonObject));

// JsonObject
console.log(JsonObject)
 
PREVIOUS NEXT
Tagged: #convert #object #array #json #javascript
ADD COMMENT
Topic
Name
8+1 =