How to convert Javascript objects into JSON?

devquora
devquora

Posted On: Feb 22, 2018

 

JSON.stringify(value); is used to convert Javascript objects into JSON.

Example Usage:

    var obj={"website":"Onlineinterviewquestions"};
    JSON.stringify(obj); // '{"website":"Onlineinterviewquestions"}'

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JSON Interview Questions

    What is JSON? For what is used for?

    JSON (JavaScript Object Notation) is a data storage and communication format based on key-value pair of JavaScript obje..

    JSON Interview Questions

    List types Natively supported by JSON?

    JSON supports Objects, Arrays, Primitives (strings, numbers, boolean values (true/false), null) data types...

    JSON Interview Questions

    What does Object.create do?

    Object.create creates a new object with the specified prototype object and properties...