How to convert Javascript objects into JSON?

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

var obj={“website”:”Onlineinterviewquestions”};
JSON.stringify(obj); // ‘{“website”:”Onlineinterviewquestions”}’