Prototypy

var Punkt = {x: 0, y: 0}

function Miasto(nazwa) {
    this.nazwa = nazwa;
}

Miasto.prototype = Punkt;
let m = new Miasto("Warszawa");
console.log(m.x);
//dodajemy funkcję do tablic
Array.prototype.drugi 
= function() {return this[1];}

let a = [10, 20, 30, 40, 50];
console.log(a.drugi())