display formatted json in the page

To Display formatted json we need to use <pre> tag and stringify the js object. Use JSON.Stringify JSON.stringify(value[, replacer [, space]]) Parameters value The value to convert to a JSON string. replacer If a function, transforms values and properties encountered while stringifying; if an array, specifies the set of properties included in objects in the…