Skip to main content
Rollback to Revision 3
Source Link
Mooing Duck
  • 66.1k
  • 19
  • 102
  • 164
Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);

SOIt is a shiteshow. Thanks for the ride.worth noting that in newer versions of JS, there are Proxy objects you can use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

SO is a shiteshow. Thanks for the ride.

Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);

It is worth noting that in newer versions of JS, there are Proxy objects you can use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

deleted 351 characters in body
Source Link
Thomas Eding
  • 1
  • 13
  • 81
  • 111
Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);

ItSO is worth noting that in newer versions of JS, there are Proxy objects you can use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxya shiteshow. Thanks for the ride.

Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);

It is worth noting that in newer versions of JS, there are Proxy objects you can use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

SO is a shiteshow. Thanks for the ride.

added 186 characters in body
Source Link
Thomas Eding
  • 1
  • 13
  • 81
  • 111
Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);

It is worth noting that in newer versions of JS, there are Proxy objects you can use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);
Function.prototype.callWithIntercept = function () {
    alert("intercept");
    return this.apply(null, arguments);
};

var num = parseInt.callWithIntercept("100px", 10);

It is worth noting that in newer versions of JS, there are Proxy objects you can use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy

added 1 characters in body
Source Link
Thomas Eding
  • 1
  • 13
  • 81
  • 111
Loading
Source Link
Thomas Eding
  • 1
  • 13
  • 81
  • 111
Loading