Edit in JSFiddle

function formatCurrency(format) {
  this.format = format;
}

const handler = {
  construct: function(target, args) {
    return new target("$" + args[0]);
  }
};

const proxy = new Proxy(formatCurrency, handler);

document.write(new proxy('100').format); // Result -> $100