renovations
This commit is contained in:
parent
b76c541212
commit
166beb5e10
5 changed files with 42 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
Пример кода (кроме IE10-):
|
||||
|
||||
<div style="position:relative">
|
||||
```js
|
||||
//+ run
|
||||
var animal = { eats: true };
|
||||
|
@ -26,13 +27,26 @@ rabbit.__proto__ = animal;
|
|||
alert(rabbit.jumps); // true
|
||||
alert(rabbit.eats); // true
|
||||
```
|
||||
<div style="position:absolute;left:0;top:0;bottom:0;right:0"><img src="proto-animal-rabbit.svg"></div>
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
<li>Первый `alert` здесь работает очевидным образом -- он выводит свойство `jumps` объекта `rabbit`.</li>
|
||||
<li>Второй `alert` хочет вывести `rabbit.eats`, ищет его в самом объекте `rabbit`, не находит -- и продолжает поиск в объекте `rabbit.__proto__`, то есть, в данном случае, в `animal`.</li>
|
||||
</ol>
|
||||
|
||||
Иллюстрация происходящего (поиск идет снизу вверх):
|
||||
Иллюстрация происходящего при чтении `rabbit.eats` (поиск идет снизу вверх):
|
||||
|
||||
```js
|
||||
var animal = {
|
||||
eats: true
|
||||
};
|
||||
|
||||
var rabbit = {
|
||||
jumps: true
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
<img src="1.png">
|
||||
|
||||
|
|
22
1-js/9-prototypes/1-prototype/proto-animal-rabbit.svg
Normal file
22
1-js/9-prototypes/1-prototype/proto-animal-rabbit.svg
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="347px" height="163px" viewBox="0 0 347 163" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>proto-animal-rabbit</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="proto-animal-rabbit" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g sketch:type="MSLayerGroup">
|
||||
<rect id="Rectangle-1" opacity="0.01" fill="#979797" sketch:type="MSShapeGroup" x="0" y="0" width="347" height="163"></rect>
|
||||
<g id="Line-+-Line-+-Line" transform="translate(275.000000, 40.000000)" stroke="#D0011B" stroke-linecap="square" sketch:type="MSShapeGroup">
|
||||
<path d="M0.5,101.514286 C0.5,101.514286 39.4570312,96.9360491 39.4570312,51.4857143 C39.4570312,6.03537946 0.5,1.45714286 0.5,1.45714286" id="Line"></path>
|
||||
<path d="M0.5,1.45714286 L10.5,9.22857143" id="Line"></path>
|
||||
<path d="M0.5,1.45714286 L13.5,1.45714286" id="Line"></path>
|
||||
</g>
|
||||
<g id="Line-+-Line-+-Line-2" transform="translate(274.000000, 17.000000)" stroke="#D0011B" stroke-linecap="square" sketch:type="MSShapeGroup">
|
||||
<path d="M0.5,2.45714286 L10.5,10.2285714" id="Line-3"></path>
|
||||
<path d="M1.1875,19.9190476 C1.1875,19.9190476 15.7963867,19.1220178 15.7963867,11.2095238 C15.7963867,3.29702977 1.1875,2.5 1.1875,2.5" id="Line"></path>
|
||||
<path d="M1.5,2.45714286 L12.5,0.5" id="Line-2"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
2
export-plunks.sh
Executable file
2
export-plunks.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
mongoexport -d js -c plunks --jsonArray >plunks.json
|
2
import-plunks.sh
Executable file
2
import-plunks.sh
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
mongoimport -d js -c plunks --jsonArray --drop <plunks.json
|
1
plunks.json
Normal file
1
plunks.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue