The Serializer
Easy+15 XP
Mission Briefing
The transmission tower only accepts flat text strings, but our data is stored in complex objects! You must serialize the payload before broadcasting.
The Concept: JSON Mastery
JavaScript Object Notation (JSON) is the standard format for sending data across the web. The JSON.stringify() method effortlessly converts a JavaScript object or value into a JSON string.
Example: JSON.stringify({ a: 1 }); // Returns '{"a":1}'
The Objective
Your function receives a JavaScript object obj.
- Convert the
objinto a JSON string usingJSON.stringify(). - Return the resulting string.
01EXAMPLE 1
Input
obj = { a: 1 }Output
'{"a":1}'Constraints
- Use JSON.stringify().
CoreJSON
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
obj{"a":1}
Expected Output
{"a":1}Click RUN to test your solution