°³Ã¼°¡ ƯÁ¤ Ŭ·¡½ºÀÇ ÀνºÅϽºÀÎÁö ¿©ºÎ¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀ» ¹ÝȯÇÑ´Ù.

 result=object instanceof class
Àμö
result (°á°ú°ª º¯¼ö)
ÇʼöÀûÀÎ ¿ä¼Ò·Î¼­ ÀÓÀÇÀÇ º¯¼öÀÌ´Ù.
object (°³Ã¼)
ÇʼöÀûÀÎ ¿ä¼Ò·Î¼­. ÀÓÀÇÀÇ °³Ã¼ ½ÄÀÌ´Ù.
class (Ŭ¶ó½º)
ÇʼöÀûÀÎ ¿ä¼Ò·Î¼­ Á¤ÀÇµÈ °³Ã¼ Ŭ·¡½ºÀÌ´Ù.
¼³¸í

instanceof ¿¬»êÀÚ´Â ¸¸¾à object°¡ classÀÇ ÀνºÅϽºÀ̸é true¸¦ ¹ÝȯÇÑ´Ù.
object°¡ ÁöÁ¤µÈ Ŭ·¡½ºÀÇ ÀνºÅϽº°¡ ¾Æ´Ï°Å³ª object°¡ nullÀ̸é false¸¦ ¹ÝȯÇÑ´Ù.

±¸¹® ¿¹Á¦
<SCRIPT>arr=new Array();arr['birth']=Date;document.write(new Date() instanceof arr['birth'])</SCRIPT>


instanceof ¿¬»êÀÚ ¿¹Á¦

<SCRIPT>
function area(x,y){
   return x*y;
}

function string(s){
   return ('¹®ÀÚ¿­['+ s + ']');
}
var newSqr = new area;
document.write ('var newSqr = new area<BR><BR>');
document.write ('newSqr  <FONT color=brown>instanceof</FONT>  area<BR>');
document.write(newSqr +'  <FONT color=red>instanceof</FONT>  '+area+' ');
document.write('<FONT color=blue><B>'+(newSqr instanceof area)+'</B></FONT><BR><BR>');

document.write ('newSqr  <FONT color=brown>instanceof</FONT> string<BR>');
document.write(newSqr +'  <FONT color=red>instanceof</FONT> '+string+' ');
document.write('<FONT color=blue><B>'+(newSqr instanceof string)+'</B></FONT><BR><BR>');
</SCRIPT>

instanceof ¿¬»êÀÚ ¿¹Á¦

<SCRIPT>
function objTest(obj){
  var i,myArray,str=''; // º¯¼ö¸¦ ¸¸µç´Ù.
  myArray=new Array(); // ¹è¿­À» ¸¸µç´Ù.
  myArray['Date']=Date; // ¹è¿­À» ä¿î´Ù.
  myArray['Object']=Object;
  myArray['Array']=Array;
  for (i in myArray){
    if (obj instanceof myArray[i]){ // obj Ŭ·¡½º¸¦ °Ë»çÇÑ´Ù.
      str+='obj´Â '+i+'ÀÇ ÀνºÅϽºÀÌ´Ù.<BR>';
    } else {
      str +='obj´Â '+i+'ÀÇ ÀνºÅϽº°¡ ¾Æ´Ï´Ù.<BR>';
    }
  }
  return (str);  // ¹®ÀÚ¿­À» ¹ÝȯÇÑ´Ù.
}

var obj=new Date(); // »õ·Î¿î ³¯ÀÚ °³Ã¼¸¦ ¸¸µë
document.write(objTest(obj)); // ±â´ÉÇÔ¼ö¸¦ ÅëÇÑ °á°ú Ãâ·Â
</SCRIPT>