added Kutya
This commit is contained in:
52
fatcsabi.js
Normal file
52
fatcsabi.js
Normal file
@@ -0,0 +1,52 @@
|
||||
let url = "https://jsonplaceholder.typicode.com/posts";
|
||||
|
||||
|
||||
async function asd(url) {
|
||||
try{
|
||||
let result = await fetch(url);
|
||||
let jsadatszerkezet = await result.json();
|
||||
console.log(jsadatszerkezet);
|
||||
} catch {
|
||||
console.log("ERROR");
|
||||
} finally {
|
||||
console.log("END");
|
||||
}
|
||||
}
|
||||
|
||||
//asd(url);
|
||||
|
||||
|
||||
async function name(url) {
|
||||
fetch(url, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
|
||||
body: JSON.stringify({
|
||||
name: "Szabó Márton",
|
||||
email: "digivagyok@gmail.com"
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
class Szemely{
|
||||
#nev;
|
||||
constructor(nev){
|
||||
this.#nev = nev;
|
||||
}
|
||||
|
||||
get nev(){
|
||||
return this.#nev;
|
||||
}
|
||||
|
||||
set nev(ujnev){
|
||||
this.#nev = ujnev;
|
||||
}
|
||||
}
|
||||
|
||||
let digi = new Szemely("Digi");
|
||||
|
||||
digi.nev = "Szabó Márton";
|
||||
console.log(digi.nev);
|
||||
Reference in New Issue
Block a user