instanceof principle

learning mark

 

The principle of instanceof to detect whether an object A is an instance of another object B is to check whether the object pointed to by the prototype of object B is on the [[prototype]] chain of object A. Returns true if it is, false if it is not. However, there is a special case, when the prototype of object B is null, an error will be reported (similar to a null pointer exception).

 

https://www.ibm.com/developerworks/cn/web/1306_jiangjj_jsinstanceof/

 

http://www.cnblogs.com/fool/archive/2010/10/14/1850910.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326506972&siteId=291194637