how to beautify code json code example
Example 1: json beautify
fetch('https://fakestoreapi.com/products?limit=5')
.then(res=>res.json())
.then(json=>console.log(json))
Example 2: json beautify
fetch('https://fakestoreapi.com/products',{
method:"POST",
body:JSON.stringify(
{
title: 'test product',
price: 13.5,
description: 'lorem ipsum set',
image: 'https://i.pravatar.cc',
category: 'electronic'
}
)
})
.then(res=>res.json())
.then(json=>console.log(json))