Postaví pred objekt zástupcu, ktorý prístup k nemu riadi alebo odkladá.
class Image { draw() { throw new Error('abstraktná metóda'); }} class RealImage extends Image { constructor(path) { super(); // Expensive: reads the whole file from disk. this.data = load(path); } draw() { // draws the loaded data }} class ImageProxy extends Image { constructor(path) { super(); this.path = path; this.real = null; } draw() { if (this.real === null) { this.real = new RealImage(this.path); } this.real.draw(); }} const image = new ImageProxy('map.png');image.draw(); // only now is it read from diskimage.draw(); // the second time nothing is read