Flash Lite 2 |
|||
| Flash Lite 2.x ActionScript リファレンスガイド > ActionScript 言語エレメント > 演算子 > instanceof 演算子 | |||
object instanceof classConstructor
object が classConstructor のインスタンスまたは classConstructor のサブクラスであるかどうかをテストします。instanceof 演算子は、プリミティブタイプをラッパーオブジェクトに変換しません。たとえば、次のコードは true を返します。
new String("Hello") instanceof String;
一方、次のコードは false を返します。
"Hello" instanceof String;
使用できるバージョン : ActionScript 1.0、Flash Lite 2.0
object : Object - ActionScript オブジェクト。
classConstructor : Function - String や Date などの ActionScript コンストラクタ関数への参照。
Boolean - object が classConstructor のインスタンスまたはサブクラスである場合、instanceof は true を返し、そうでない場合は false を返します。また、_global instanceof Object は false を返します。