7.
Which built-in method is used to serialize an object into a JSON string in JavaScript?
JSON.parse()
JSON.stringify()
JSON.serialize()
JSON.tostring()
Correct: B
The JSON.stringify() method is used to convert an object into a JSON string representation. This method serializes the object by converting its properties and values into a JSON format, allowing the object to be easily stored, transmitted, or used in JavaScript applications.