Untitled
unknown
plain_text
10 months ago
310 B
15
Indexable
let ogrenci = {
ad: "Betül",
soyad: "Köroğlu",
notlar: [80, 90, 70, 100],
ortalama: function() {
let toplam = 0;
for (let i = 0; i < this.notlar.length; i++) {
toplam += this.notlar[i];
}
return toplam / this.notlar.length;
}
};
console.log("Ortalama:", ogrenci.ortalama());Editor is loading...
Leave a Comment