Json.stringify (), Json.parse (), ToJSON () method use

Source: Internet
Author: User
Tags tojson
Json.stringify (): Value (Object,array,string,number ...) Serialized as JSON string Json.parse (): Parsing JSON data into JS native value Tojson (), as the second parameter in json.stringify (function filter) complements, it is important to understand the internal order. Suppose that an object is passed into the Json.stringify () serialized object in the following order: (1) The method is called if the Tojson () method is present and can be used to obtain a valid value. Otherwise, the serialization is performed in the default order (2) If the second parameter is provided, the function filter is applied, and the value of the passed-in function filter is the value returned by step (1). (3) The corresponding serialization of each value returned by step (2). (4) If a third parameter is provided, the corresponding format operation is performed. Json.tojsonstring (): Object to JSON string.

Json.stringify (), Json.parse (), ToJSON () method use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.