Can we delete the “getContext” property of HTML5 Canvas tag through script?

HTMLWeb DevelopmentFront End Technology

There is no description in HTML5 specification, which says deletion of a getContext property by the script is valid.

We can write a code in which we delete getContext property of HTMLCanvasElement and then in the separate statement we make it undefined.

Delete window.HTMLCanvasElement.prototype.getContext;

_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined,
   "window.HTMLCanvasElement.prototype.getContext", "undefined");
Published on 21-Mar-2018 12:42:37