Skip to content

Commit 781a8f4

Browse files
committed
x1 yoga
1 parent c639b0c commit 781a8f4

File tree

3 files changed

+129
-0
lines changed

3 files changed

+129
-0
lines changed

doc/en/object/forinloop.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ libraries like [Prototype][1], which does not yet take advantage of new ECMAScri
5454
When this framework is included, `for in` loops that do not use
5555
`hasOwnProperty` are guaranteed to break.
5656

57+
> Tried in jeforth
58+
> js> [].length . \ ==> 0 OK
59+
> js> [] obj>keys . \ ==> "" OK
60+
> js> [].hasOwnProperty("length") \ ==> true (boolean)
61+
> So 'length' is a non-enumerable property of an array.
62+
5763
### In Conclusion
5864

5965
It is recommended to **always** use `hasOwnProperty` in ECMAScript 3 or lower, as well as

doc/en/object/general.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ as objects too.
2222
2..toString(); // the second point is correctly recognized
2323
2 .toString(); // note the space left of the dot
2424
(2).toString(); // 2 is evaluated first
25+
2["toString"](); // alternative notation avoids using the dot
2526

2627
### Objects as a Data Type
2728

log.txt

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
2+
[x] The "javascript garden" project needs to be built before browsing according to CONTRIBUTING.md
3+
So I run the build command line:
4+
Microsoft Windows [Version 10.0.14393]
5+
(c) 2016 Microsoft Corporation. All rights reserved.
6+
7+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm run build
8+
9+
> [email protected] build c:\Users\hcche\Documents\GitHub\JavaScript-Garden
10+
> node build.js
11+
12+
module.js:327
13+
throw err;
14+
^
15+
16+
Error: Cannot find module 'lodash'
17+
at Function.Module._resolveFilename (module.js:325:15)
18+
at Function.Module._load (module.js:276:25)
19+
at Module.require (module.js:353:17)
20+
at require (internal/module.js:12:17)
21+
at Object.<anonymous> (c:\Users\hcche\Documents\GitHub\JavaScript-Garden\build.js:2:9)
22+
at Module._compile (module.js:409:26)
23+
at Object.Module._extensions..js (module.js:416:10)
24+
at Module.load (module.js:343:32)
25+
at Function.Module._load (module.js:300:12)
26+
at Function.Module.runMain (module.js:441:10)
27+
28+
npm ERR! Windows_NT 10.0.14393
29+
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run
30+
" "build"
31+
npm ERR! node v4.4.3
32+
npm ERR! npm v2.15.1
33+
npm ERR! code ELIFECYCLE
34+
npm ERR! [email protected] build: `node build.js`
35+
npm ERR! Exit status 1
36+
npm ERR!
37+
npm ERR! Failed at the [email protected] build script 'node build.js'.
38+
npm ERR! This is most likely a problem with the javascript-garden package,
39+
npm ERR! not with npm itself.
40+
npm ERR! Tell the author that this fails on your system:
41+
npm ERR! node build.js
42+
npm ERR! You can get information on how to open an issue for this project with:
43+
npm ERR! npm bugs javascript-garden
44+
npm ERR! Or if that isn't available, you can get their info via:
45+
npm ERR!
46+
npm ERR! npm owner ls javascript-garden
47+
npm ERR! There is likely additional logging output above.
48+
49+
npm ERR! Please include the following file with any support request:
50+
npm ERR! c:\Users\hcche\Documents\GitHub\JavaScript-Garden\npm-debug.log
51+
52+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>
53+
[ ] check the error, RI: a module "lodash" is missing. So I studied and found how to install
54+
that module: http://www.w3cplus.com/javascript/lodash-intro.html ( See my Ynote and Evernote )
55+
--> install lodash:
56+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm install --save lodash
57+
npm WARN package.json [email protected] No repository field.
58+
npm WARN package.json [email protected] No license field.
59+
[email protected] node_modules\lodash
60+
--> ok? Try building j/g again:
61+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm run build
62+
> [email protected] build c:\Users\hcche\Documents\GitHub\JavaScript-Garden
63+
> node build.js
64+
module.js:327
65+
throw err;
66+
^
67+
Error: Cannot find module 'jade'
68+
at Function.Module._resolveFilename (module.js:325:15)
69+
at Function.Module._load (module.js:276:25)
70+
at Module.require (module.js:353:17)
71+
at require (internal/module.js:12:17)
72+
at Object.<anonymous> (c:\Users\hcche\Documents\GitHub\JavaScript-Garden\build.js:3:12)
73+
at Module._compile (module.js:409:26)
74+
at Object.Module._extensions..js (module.js:416:10)
75+
at Module.load (module.js:343:32)
76+
at Function.Module._load (module.js:300:12)
77+
at Function.Module.runMain (module.js:441:10)
78+
--> so, again, missing 'jade' module.
79+
--> install jade:
80+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm install --save jade
81+
--> try again:
82+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm run build
83+
Error: Cannot find module 'marked'
84+
at Function.Module._resolveFilename (module.js:325:15)
85+
at Function.Module._load (module.js:276:25)
86+
--> so, again, missing 'marked' module.
87+
--> install marked:
88+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm install --save marked
89+
--> try again:
90+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm run build
91+
92+
> [email protected] build c:\Users\hcche\Documents\GitHub\JavaScript-Garden
93+
> node build.js
94+
95+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>
96+
==> OK now, Bingo!
97+
Taget directory c:\Users\hcche\Documents\GitHub\JavaScript-Garden\site
98+
was very empty but now is full of different languages and index.html appears.
99+
[x] Modify the 'prototype.md' to be :
100+
JavaScript 不包含傳統的「類」繼承的模型,它使用的是「原型」模型。
101+
儘管這常被認為是 JavaScript 的缺點,但「原型繼承模型」其實比「類繼承模型」更強大。
102+
在「原型繼承模型」上實現傳統的「類繼承模型」是小事一件,但反過來要在只有「類繼承模
103+
型」的地方弄出「原型繼承模型」則要困難很多。
104+
--> submit --> push to my fork.
105+
[x] How to make a PR (Pull request)?
106+
--> Found a [New pull request] button on my repo's home page. --> click it, switched
107+
to a page "Comparing changes" and it says : Choose two branches to see what’s changed or
108+
to start a new pull request. If you need to, you can also compare across forks. --> so
109+
I check the difference and it's fine. The page also says : "Able to merge. These branches
110+
can be automatically merged." so I am about to proceed.
111+
--> And, for the safe, I rebuilt again:
112+
c:\Users\hcche\Documents\GitHub\JavaScript-Garden>npm run build
113+
> [email protected] build c:\Users\hcche\Documents\GitHub\JavaScript-Garden
114+
> node build.js
115+
and then view the changes on my local browser to make sure it works fine:
116+
file:///C:/Users/hcche/Documents/GitHub/JavaScript-Garden/site/zhtw/index.html#object.prototype
117+
--> OK!
118+
--> There's a button "[Create pull request] Discuss and review the changes in this comparison
119+
with others." and I click it . . .
120+
--> follow the process to provide some descriptions and then submit and DONE!
121+
The pull request is really went to the original repo BonsaiDen/JavaScript-Garden
122+

0 commit comments

Comments
 (0)