Last active
July 27, 2022 22:40
-
-
Save geraldotech/a32502f47623f7e8f5b6e59a06306b1f to your computer and use it in GitHub Desktop.
parse response.json to json obj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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