Augmented Classical Interitance section of About page with isA() information
parent
c3c769060c
commit
279931cd0b
13
index.html
13
index.html
|
@ -92,7 +92,18 @@
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To prevent a class from being extended, <tt>FinalClass</tt> can be used.
|
Type checks for polymorphic methods may be performed with
|
||||||
|
<tt>Class.isA()</tt>, which is <a
|
||||||
|
href="manual/Type-Checks-and-Polymorphism.html" class="man">recommended in
|
||||||
|
place of <tt>instanceof</tt></a>.
|
||||||
|
</p>
|
||||||
|
<pre class="js">
|
||||||
|
<!--%inc scripts/ex/class-poly.js-->
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
To prevent a class from being extended, <a href="manual/Final-Classes.html"
|
||||||
|
class="man"><tt>FinalClass</tt></a> may be used.
|
||||||
</p>
|
</p>
|
||||||
<pre class="js">
|
<pre class="js">
|
||||||
<!--%inc scripts/ex/class-final.js-->
|
<!--%inc scripts/ex/class-final.js-->
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
var cow = Cow(),
|
||||||
|
sturdy = SturdyCow();
|
||||||
|
|
||||||
|
Class.isA( Cow, cow ); // true
|
||||||
|
Class.isA( SturdyCow, cow ); // false
|
||||||
|
Class.isA( Cow, sturdy ); // true
|
||||||
|
Class.isA( SturdyCow, sturdy ); // true
|
Loading…
Reference in New Issue