JavaScript classkit_method_remove function

A JavaScript equivalent of PHP’s classkit_method_remove
function classkit_method_remove (classname, methodname) {
  // http://kevin.vanzonneveld.net
  // +   original by: Brett Zamir (http://brett-zamir.me)
  // *     example 1: classkit_method_remove('someClass', 'someMethod');
  // *     returns 1: true

  if (typeof classname === 'string') {
    classname = this.window[classname];
  }
  delete classname.prototype[methodname]; // Delete any on prototype
  // delete classname[methodname]; // Delete any as static class method
  return true;
}

Example 1
classkit_method_remove('someClass', 'someMethod');

Should return
true
Теги:
classkit_method_remove
Добавлено: 25 Июля 2018 19:29:32 Добавил: Андрей Ковальчук Нравится 0
Добавить
Комментарии:
Нету комментариев для вывода...