Created
February 18, 2015 10:13
-
-
Save st98/a63d0e6ac605dc1bd11a to your computer and use it in GitHub Desktop.
delete。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function C() {} | |
C.prototype.m = function () { return 'm'; }; | |
///// | |
var a = new C(); | |
a.m(); // => 'm' | |
///// | |
delete a.m; | |
a.m(); // => 'm' | |
///// | |
delete C.prototype.m; | |
a.m(); // => TypeError: undefined is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment