Skip to content

Instantly share code, notes, and snippets.

@yuxel
Created August 22, 2011 12:12
Show Gist options
  • Select an option

  • Save yuxel/1162234 to your computer and use it in GitHub Desktop.

Select an option

Save yuxel/1162234 to your computer and use it in GitHub Desktop.
javascript prototype kaka
var Yemekler = function () {
var that = this;
this.liste = [];
this.ekle = function (yemekAdi) {
that.liste.push(yemekAdi);
};
this.listele = function () {
console.log(this.liste);
};
};
var Insan = function () {
}
Insan.prototype.yemekler = new Yemekler();
var osman = new Insan();
osman.yemekler.ekle("kaburga");
var mehmet = new Insan();
mehmet.yemekler.ekle('pizza');
mehmet.yemekler.listele();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment