25 lines
451 B
JavaScript
25 lines
451 B
JavaScript
|
|
// fetch('https://jsonplaceholder.typicode.com/posts')
|
|
// .then(res=>res.json())
|
|
// .then(adatok=>console.log(adatok))
|
|
// .catch(err=>console.log(err))
|
|
|
|
|
|
|
|
|
|
|
|
async function letolt() {
|
|
try {
|
|
let keres=await fetch('https://jsonplaceholder.typicode.com/posts/1');
|
|
let valasz=await keres.json();
|
|
|
|
console.log(valasz);
|
|
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
}
|
|
|
|
letolt();
|
|
|
|
console.log("Valami"); |