func(this.ctx);はどういう意味ですか?

順を追って説明していきます。
2020年10月24日
ユーザー

drawメソッドの第2引数(func)の意味がよくわかりません。
18行目に出てくる func(this.ctx); はどういう用法でどういう意味を持っているのでしょうか?


draw(angle, func) {
this.ctx.save();

this.ctx.translate(this.width / 2, this.height / 2);
this.ctx.rotate(Math.PI / 180 * angle);

this.ctx.beginPath();
func(this.ctx);
this.ctx.stroke();

this.ctx.restore();

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

プレミアムプランとは?