JSON Stringify vs JSON Parse

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: SALESFORCE PREDATOR
3,411
59

In this video we will discuss about :
JSON.Stringify()


JSON.Stringify()
To convert JavaScript object to String.

To convert array into String.

It removes any functions from a JavaScript object, both the key and the value

To avoid this, convert your functions into strings before running the JSON.stringify() function.

Date Objects are converted into strings

Usage:

When sending data to a web server, the data has to be a string.

It is also used while Storing data in local storage of browsers.

JSON.Parse()
To convert String to JavaScript object .

JSON.parse() on a JSON derived from an array, will return a JavaScript array.

When receiving data from a web server, the data is always a string. Parse the data with JSON.parse(), and the data becomes a JavaScript object.

You should avoid using functions in JSON, the functions will lose their scope, and you would have to use eval() to convert them back into functions.

Date objects are not allowed in JSON. If you need to include a date, write it as a string.

JavaScript Playlist Link :    • Salesforce Certified JavaScript Professional  


Auf dieser Seite können Sie das Online-Video JSON Stringify vs JSON Parse mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer SALESFORCE PREDATOR 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 3,411 Mal angesehen und es wurde von 59 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!