2020年5月16日解決済み

「setTimeout(this.spin, 50);」とすると動かないのはなぜですか?

ユーザー

お世話になります。
setTimeoutについてですが、

 setTimeout(()=>{this.spin();},50);

だと動きますが、

 setTimeout(this.spin,50);

だと動きませんでした。

以前までのレッスンでは2番目の書き方でも動いていたのですが。
this.getrandomImage is not a function at spin. とエラーがでます。

よろしくお願いします。

スタッフ

この回答を見るにはプレミアムプランへの登録が必要です

プレミアムプランとは?