You may use the JSON.stringify( value, replacer, space ) function to convert a JavaScript object to JSON. Stringify( ) serializes objects, arrays, and basic values into a JSON data string.