Json Flashcards

1
Q

JSON.parse(data)

A

Parse the string text as JSON, optionally transform the produced value and its properties, and return the value. Any violations of the JSON syntax, including those pertaining to the differences between JavaScript and JSON, cause a SyntaxError to be thrown. The reviver option allows for interpreting what the replacer has used to stand in for other datatypes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

JSON.stringify(data)

A

Return a JSON string corresponding to the specified value, optionally including only certain properties or replacing property values in a user-defined manner. By default, all instances of undefined are replaced with null, and other unsupported native data types are censored. The replacer option allows for specifying other behavior.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly