[Solved] How to create JSON data in JS [duplicate]


Just create your object as a plain JavaScript object:

var object = {
  email: "[email protected]",
  profile: {
    token: "test"
  }
}

Then convert it to JSON:

var json = JSON.stringify(object);

solved How to create JSON data in JS [duplicate]