Which method converts a JavaScript object to a JSON string?

JavaScript Professional Easy

JavaScript Professional — Easy

Which method converts a JavaScript object to a JSON string?

Key points

  • JSON.stringify() converts JavaScript objects to JSON strings.
  • JSON.parse() is used to parse JSON strings back into JavaScript objects.
  • JSON.encode() and JSON.serialize() are not valid methods for converting objects to JSON strings.

Ready to go further?

Related questions