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.

  1. Convert the obj into a JSON string using JSON.stringify().
  2. Return the resulting string.

01EXAMPLE 1

Inputobj = { a: 1 }
Output'{"a":1}'

Constraints

  • Use JSON.stringify().
CoreJSON
JavaScript
Loading...
3 Hidden

Input Arguments

obj{"a":1}

Expected Output

{"a":1}

Click RUN to test your solution