I have a class that was created like this:
function T() {
this.run = function() {
if (typeof this.i === \'undefined\')
this.i = 0;
Class not same function are different. Not work a delete. Class is system modification.
class SAFunc {
method1(){
console.log("1");
}
method2(){
console.log("2");
}
}
let func = new SAFunc();
func['method2']()
Try:
delete window['func'] -- not workdelete eval['func'] -- not workdelete window['SAFunc'] -- not workFunction - command work delete
method1 = function(){
console.log("func1");
}
function method2() {
console.log("func2");
}
var SAFunc = { method3: function() { console.log("func3"); } }
Make ur test... Try:
delete window['method1']delete window['method2']delete SAFunc['method3']Good fun! i love programming
Enjoin us ;)