func()
{
const curVal = this.curVal;
const callAgain =() => { func(); };
Axios.get('somecontroller/someaction')
.then(response =>
{
const newVal = response.data.curVal;
if(curVal === newVal)
setTimeout(callAgain, 500);
else
// ....
})
.catch(response =>
{
// ...
});
}
のような機能を持っており、私のブラウザがfunc
がundefined
だと言っライン
const callAgain =() => { func(); };
文句を言っています。どんな考え?どうすれば修正できますか?
'funcは何であるコード
{ ... }
のブロックを実行しようとしていると考えて()\ nは{...}'正確に?関数呼び出しの後にブロックが続くのか? 'func(){...}'がオブジェクトメソッド定義である場合、 'func'は' undefined'です。オブジェクトメソッドはローカルスコープ内で自身のバインディングを作成しないからです。 –