




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Consider the 4 possibilities. The object could be an array, an object, a string, or another type.
Think about the problem recursively. If you know how to convert any sub-data into a string, how could you use it to convert the entire data into a string?
If the data is a string, it's just the value surrounded by double quotes. If the data is another type, its just String(data). If the data is an array, it's the recursively stringified value of each item separated by commas. If the data is an object, it's a series of key-value pairs where each value is the recursively stringified value.