JavaScript
Write a function named "to_json" that takes any valid type as a parameter and returns the input as a JSON formatted string. For example, if the input is a key-value store this function should return a JSON string representing an object containing the same data
function to_Json(var toJSON){
return JSON.stringify(toJSON);
}
this function when called with any argument will return the
argument to a JSON String and will return that from
function.
JavaScript Write a function named "to_json" that takes any valid type as a parameter and returns...