Last active
June 6, 2019 18:37
-
-
Save iamburakcoskun/78a6c5ab4370b64ddf3b3d23d8153214 to your computer and use it in GitHub Desktop.
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
let kitaplar = [{ | |
"yazar": "Zülfü Livaneli", | |
"baslik": "Serenad" | |
}, | |
{ | |
"yazar": "Sabahattin Ali", | |
"baslik": "İçimizdeki Şeytan" | |
} | |
] | |
function kitapEkle() { | |
setTimeout(() => { | |
kitaplar.push({ "yazar": "John Steinbeck", "baslik": "Fareler ve İnsanlar" }) | |
}, 3000); | |
} | |
function tumKitaplariSorgula() { | |
setTimeout(() => { | |
let output = "<ul>"; | |
kitaplar.forEach(function(kitap) { | |
output += "<li>" + kitap.yazar + " - " + kitap.baslik + "</li>"; | |
}) | |
output += "</ul>"; | |
document.getElementById("output").innerHTML = output; | |
}, 2000); | |
} | |
kitapEkle(); | |
tumKitaplariSorgula(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment