Untitled

 avatar
unknown
plain_text
10 months ago
328 B
12
Indexable
const ogrenci = {
  ad: "Poyraz",
  soyad: "Bektaş",
  notlar: [80, 90, 70, 100],
  ortalama: function () {
    let toplam = 0;
    for (let n of this.notlar) {
      toplam += n;
    }
    return toplam / this.notlar.length;
  }
};

console.log(`${ogrenci.ad} ${ogrenci.soyad} ortalama: ${ogrenci.ortalama()}`);
Editor is loading...
Leave a Comment