相关疑难解决方法(0)

如何从该函数中获取函数名?

如何从该函数内部访问函数名?

// parasitic inheritance
var ns.parent.child = function() {
  var parent = new ns.parent();
  parent.newFunc = function() {

  }
  return parent;
}

var ns.parent = function() {
  // at this point, i want to know who the child is that called the parent
  // ie
}

var obj = new ns.parent.child();
Run Code Online (Sandbox Code Playgroud)

javascript function

242
推荐指数
12
解决办法
21万
查看次数

标签 统计

function ×1

javascript ×1