If I defined an object in JS with:
var j={\"name\":\"binchen\"};
How can I convert the object to JSON? The output string should be:
convert str => obj
const onePlusStr = '[{"brand":"oneplus"},{"model":"7T"}]';
const onePLusObj = JSON.parse(onePlusStr);
convert obj => str
const onePLusObjToStr = JSON.stringify(onePlusStr);
References of JSON parsing in JS: JSON.parse() : click JSON.stringify() : click