次のJavaScriptはなぜですか
Math instanceof Math
エラーをスローします
TypeError: Expecting a function in instanceof check, but got #<Object>
?
次のJavaScriptはなぜですか
Math instanceof Math
エラーをスローします
TypeError: Expecting a function in instanceof check, but got #<Object>
?
Mathとは異なり、はコンストラクタではないためですObject。
参照してくださいinstanceof:
構文
object instanceof constructorパラメーター
object:テストするオブジェクト。
constructor:テストする関数