Postaví pred objekt zástupcu, ktorý prístup k nemu riadi alebo odkladá.
class Obraz { vykresli() { throw new Error('abstraktná metóda'); }} class SkutocnyObraz extends Obraz { constructor(cesta) { super(); // Drahé: načíta celý súbor z disku. this.data = nacitaj(cesta); } vykresli() { // vykreslí načítané dáta }} class ObrazProxy extends Obraz { constructor(cesta) { super(); this.cesta = cesta; this.skutocny = null; } vykresli() { if (this.skutocny === null) { this.skutocny = new SkutocnyObraz(this.cesta); } this.skutocny.vykresli(); }} const obraz = new ObrazProxy('mapa.png');obraz.vykresli(); // až teraz sa načíta z diskuobraz.vykresli(); // druhýkrát sa už nenačítava