Skip to content

Instantly share code, notes, and snippets.

@geraldotech
Last active July 27, 2022 22:40
Show Gist options
  • Save geraldotech/a32502f47623f7e8f5b6e59a06306b1f to your computer and use it in GitHub Desktop.
Save geraldotech/a32502f47623f7e8f5b6e59a06306b1f to your computer and use it in GitHub Desktop.
parse response.json to json obj
const api = 'http://127.0.0.1/Dev/Javascript/JSON/my_local_json/dados2.json';
async function essaurl(url){
const response = await fetch(url);
const data = await response.json();
if(response){
show(data)
}
}
essaurl(api);
function show(data){
console.log(data)
data.forEach(ele => {
console.log(ele)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment