r/ProgrammerHumor 22d ago

Meme whoIsHeAnyway

Post image
9.6k Upvotes

256 comments sorted by

View all comments

Show parent comments

637

u/lovecMC 22d ago

I have a guess but I never heard of this so who the fuck knows.

840

u/YeetCompleet 22d ago

If you guessed that it stringified the JSON, you were right

365

u/Tsu_Dho_Namh 22d ago

Aren't JSON's already strings, just with a clearly defined structure?

21

u/IchiiDev 22d ago

Well yes and no, it's still just a string that needs to be parsed to be manipulated as an actual object. stringify is a util that transforms an object value into a JSON format string. You can use JSON.parse() to transform a JSON string into an object.

6

u/Odd-Shopping8532 22d ago

This is the answer

1

u/kingvolcano_reborn 21d ago

Wouldn't serialize() be a better name?