Answers for "console log json data"

2

console.log object to json

console.log(JSON. stringify(obj))  //Read Object
Posted by: Guest on June-30-2020
5

json data doesn show on console

// if your json data doesn't show then just replace this code. 
handleGetJson = () =>{
  fetch(`./data.json`, {
      headers : { 
        'Content-Type': 'application/json',
        'Accept': 'application/json'
       }
    })
     .then(res=> res.json())
     .then(data=> console.log(data))
}
Posted by: Guest on October-14-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language