Baseline Widely available
isPrototypeOf()
ë©ìëë í´ë¹ ê°ì²´ê° ë¤ë¥¸ ê°ì²´ì íë¡í íì
ì²´ì¸ì ìí ê°ì²´ì¸ì§ íì¸í기 ìí´ ì¬ì©ë©ëë¤.
êµ¬ë¬¸ì°¸ê³ :
isPrototypeOf
ëinstanceof
ì°ì°ìì ë¤ë¦ ëë¤. "object instanceof AFunction
" ííìììëobject
ì íë¡í íì ì²´ì¸ì AFunction ìì²´ê° ìëë¼AFunction.prototype
ì ëí´ íì¸ì í©ëë¤.
prototypeObj.isPrototypeOf(obj);
매ê°ë³ì
object
íë¡í íì ì²´ì¸ì ê°ì§ê³ ìë ê°ì²´ê° ê²ìë ê² ì ëë¤.
isPrototypeOf
ë©ìëë ë ë¤ë¥¸ ê°ì²´ì íë¡í íì
ì²´ì¸ì í´ë¹ ê°ì²´ê° ì¡´ì¬íëì§ ì¬ë¶ë¥¼ íì¸í ì ììµëë¤.
ì를ë¤ì´, ë¤ìì íë¡í íì ì²´ì¸ì ê³ ë ¤í´ë´ ìë¤.
function Fee() {
// ...
}
function Fi() {
// ...
}
Fi.prototype = new Fee();
function Fo() {
// ...
}
Fo.prototype = new Fi();
function Fum() {
// ...
}
Fum.prototype = new Fo();
ì¤íëê³ ëë©´ Fum ì¸ì¤í´ì¤ì íë¡í íì ì²´ì¸ì´ Fiì íë¡í íì ê³¼ ì°ê²°ëì´ìëì§ë¥¼ íì¸í íìê° ììµëë¤. ë¤ìê³¼ ê°ì ë°©ë²ì¼ë¡ íì¸í ì ììµëë¤:
var fum = new Fum();
// ...
if (Fi.prototype.isPrototypeOf(fum)) {
// do something safe
}
ì´ ë©ìëë instanceof
ì°ì°ìì í¨ê» í¹ì íë¡í íì
ì¼ë¡ë¶í° ììë ê°ì²´ë§ ìëíê² íë ¤ë(ì를 ë¤ì´ í¹ì ë©ìëë ìì±ì´ ê°ì²´ì ìë¤ë걸 ë³´ì¥íë ¤ë ë) ì½ëìì í¹í ì¸ëª¨ê° ë§ë¤.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4