それ自体の中に無名関数のインスタンスを取得する方法は?
function () {
//how to access this?
}
それは匿名である必要があり、コールバックであり、渡される関数で、プロパティをコールバックにアタッチして呼び出します。次に、その独自のプロパティを返す必要があります。
function parent (val) {
val.someProp = "abc"
val()
}
parent(function(){
return this.someProp; // how to access a someProp because this is window?
})
また、小道具を渡すこともできません。