images to svg
This commit is contained in:
parent
a31e881856
commit
3ba28aa104
734 changed files with 11682 additions and 245 deletions
|
@ -94,7 +94,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
|
|||
|
||||
Here's the illustration of what `rabbit instanceof Animal` compares with `Animal.prototype`:
|
||||
|
||||

|
||||

|
||||
|
||||
By the way, there's also a method [objA.isPrototypeOf(objB)](mdn:js/object/isPrototypeOf), that returns `true` if `objA` is somewhere in the chain of prototypes for `objB`. So the test of `obj instanceof Class` can be rephrased as `Class.prototype.isPrototypeOf(obj)`.
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 31 KiB |
51
1-js/09-classes/06-instanceof/instanceof.svg
Normal file
51
1-js/09-classes/06-instanceof/instanceof.svg
Normal file
|
@ -0,0 +1,51 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="509px" height="435px" viewBox="0 0 509 435" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: sketchtool 55.2 (78181) - https://sketchapp.com -->
|
||||
<title>instanceof.svg</title>
|
||||
<desc>Created with sketchtool.</desc>
|
||||
<g id="inheritance" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="instanceof.svg">
|
||||
<rect id="Rectangle-1" stroke="#E8C48E" stroke-width="2" fill="#FFF9EB" x="9" y="200" width="139" height="28"></rect>
|
||||
<text id="Animal.prototype" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="8" y="192">Animal.prototype</tspan>
|
||||
</text>
|
||||
<rect id="Rectangle-1" stroke="#E8C48E" stroke-width="2" fill="#FFF9EB" x="9" y="94" width="139" height="28"></rect>
|
||||
<text id="Object.prototype" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="8" y="86">Object.prototype</tspan>
|
||||
</text>
|
||||
<path id="Line-2" d="M69.5,148.5 L69.5,176.5 L67.5,176.5 L67.5,148.5 L61.5,148.5 L68.5,134.5 L75.5,148.5 L69.5,148.5 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
<rect id="Rectangle-1-Copy" stroke="#E8C48E" stroke-width="2" fill="#FFF9EB" x="9" y="307" width="139" height="28"></rect>
|
||||
<text id="Rabbit.prototype" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="8" y="299">Rabbit.prototype</tspan>
|
||||
</text>
|
||||
<path id="Line-2-Copy" d="M69.5,255.5 L69.5,283.5 L67.5,283.5 L67.5,255.5 L61.5,255.5 L68.5,241.5 L75.5,255.5 L69.5,255.5 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
<text id="[[Prototype]]" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="80" y="266">[[Prototype]]</tspan>
|
||||
</text>
|
||||
<rect id="Rectangle-1-Copy-2" stroke="#E8C48E" stroke-width="2" fill="#FFF9EB" x="9" y="398" width="139" height="28"></rect>
|
||||
<text id="rabbit" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="8" y="390">rabbit</tspan>
|
||||
</text>
|
||||
<path id="Line-2-Copy-2" d="M69.5,361.5 L69.5,389.5 L67.5,389.5 L67.5,361.5 L61.5,361.5 L68.5,347.5 L75.5,361.5 L69.5,361.5 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
<text id="[[Prototype]]-Copy-3" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="80" y="372">[[Prototype]]</tspan>
|
||||
</text>
|
||||
<text id="[[Prototype]]-Copy" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="80" y="159">[[Prototype]]</tspan>
|
||||
</text>
|
||||
<path id="Line-2" d="M71.5,41.5 L71.5,69.5 L69.5,69.5 L69.5,41.5 L63.5,41.5 L70.5,27.5 L77.5,41.5 L71.5,41.5 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
<text id="null" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="56" y="16">null</tspan>
|
||||
</text>
|
||||
<text id="[[Prototype]]-Copy-2" font-family="PTMono-Regular, PT Mono" font-size="14" font-weight="normal" fill="#8A704D">
|
||||
<tspan x="81" y="54">[[Prototype]]</tspan>
|
||||
</text>
|
||||
<text id="=-Animal.prototype?" font-family="PTMono-Regular, PT Mono" font-size="16" font-weight="normal" fill="#EE6B47">
|
||||
<tspan x="317" y="217">= Animal.prototype?</tspan>
|
||||
</text>
|
||||
<path id="Line" d="M188.656014,308.982762 L305.787391,232.115296 L306.884704,233.787391 L189.753327,310.654858 L193.045266,315.671145 L177.5,317.5 L185.364076,303.966474 L188.656014,308.982762 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
<path id="Line-Copy" d="M198.5,211.5 L305.5,211.5 L305.5,213.5 L198.5,213.5 L198.5,219.5 L184.5,212.5 L198.5,205.5 L198.5,211.5 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
<path id="Line-Copy-2" d="M194.988745,128.905563 L305.873622,196.163603 L304.836397,197.873622 L193.951521,130.615582 L190.839847,135.745639 L182.5,122.5 L198.100419,123.775506 L194.988745,128.905563 Z" fill="#EE6B47" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 75 KiB |
Loading…
Add table
Add a link
Reference in a new issue