Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1209 commits
Select commit Hold shift + click to select a range
d67929c
Updated article.md (better sentence flow)
Apr 21, 2019
b38d426
minor
iliakan Apr 21, 2019
b91abf8
minor
iliakan Apr 21, 2019
74e6955
Merge pull request #932 from cmdlhz/cmdlhz-patch-1
iliakan Apr 21, 2019
7aa1e0f
Corrected grammar
alaabouayed Apr 21, 2019
14163bb
Grammar
alaabouayed Apr 21, 2019
3b3363e
Merge pull request #934 from alaabouayed/patch-2
iliakan Apr 22, 2019
585b77d
Merge pull request #933 from alaabouayed/patch-3
iliakan Apr 22, 2019
203b8f9
fixes
iliakan Apr 22, 2019
3b14ed8
minor
iliakan Apr 22, 2019
8ef9fd2
Clarity
alaabouayed Apr 22, 2019
c5ce557
Fix name of JavaScript
lex111 Apr 23, 2019
6f55ba6
Merge pull request #936 from lex111/js-correct
iliakan Apr 23, 2019
10f84e7
6-data-storage/01-cookie: fix typo
lex111 Apr 23, 2019
b9ca311
Merge pull request #935 from alaabouayed/patch-4
iliakan Apr 23, 2019
735880d
Replace `Node.JS` with `Node.js`
lex111 Apr 23, 2019
4c2ab73
Replace `Github` with `GitHub`
lex111 Apr 23, 2019
190f0de
Corrected grammar
Violet-Bora-Lee Apr 25, 2019
743a0dc
Fix typo
h-n-y Apr 25, 2019
340c147
Merge pull request #939 from Violet-Bora-Lee/patch-1
iliakan Apr 25, 2019
8735adc
Merge pull request #940 from h-n-y/h-n-y-patch-1
iliakan Apr 25, 2019
273e47b
cleanup
iliakan Apr 25, 2019
b7b073b
Update article.md
marksq Apr 25, 2019
b2f8974
up
iliakan Apr 25, 2019
3465665
minor
iliakan Apr 25, 2019
e30d9d4
minor
iliakan Apr 25, 2019
9f06601
minor
iliakan Apr 25, 2019
65c5793
#8: fix unordered list
Antiai Apr 25, 2019
a9ee52b
#8: fix unordered list (#942)
lex111 Apr 25, 2019
f74963a
js/first-steps/function-basics: fix name of Lodash
lex111 Apr 25, 2019
04487f8
Update article.md
david-cho-lerat-HL2 Apr 26, 2019
3b20808
Update article.md
david-cho-lerat-HL2 Apr 26, 2019
076a624
Merge pull request #941 from marksq/patch-1
iliakan Apr 26, 2019
f652b9d
Merge pull request #944 from david-cho-lerat-HL2/patch-2
iliakan Apr 26, 2019
298e894
Merge pull request #943 from david-cho-lerat-HL2/patch-1
iliakan Apr 26, 2019
19223ae
minor
iliakan Apr 26, 2019
e9e3833
array-methods: wording
lex111 Apr 27, 2019
e41783a
regexp-character-classes: wording
lex111 Apr 27, 2019
10decb5
Fix typo
Apr 27, 2019
b10274c
Fix typo (#947)
lex111 Apr 27, 2019
5010620
Update article.md
Okoyecb Apr 27, 2019
f2328f0
Fix typo: authomatically
lex111 Apr 28, 2019
ad8a717
Array methods: minor mistake
shchegol Apr 29, 2019
6b9515f
minor
iliakan Apr 30, 2019
ae87b1a
Fix typo dynamicaly to dinamically
Apr 30, 2019
c0d068d
Fix typo dynamicaly to dinamically (#951)
lex111 Apr 30, 2019
2802a6d
replace "press" with "click"
pimonenkov Apr 30, 2019
aaab1d4
Update article.md
afeldspar Apr 30, 2019
593e122
fix
iliakan Apr 30, 2019
f8ef37f
21-regexp-unicode-properties: fix title
lex111 Apr 30, 2019
00654e3
Merge pull request #953 from afeldspar/patch-1
iliakan Apr 30, 2019
aa67109
Merge pull request #952 from pimonenkov/patch-2
iliakan Apr 30, 2019
7d23fd8
Merge pull request #949 from shchegol/master
iliakan Apr 30, 2019
0af081d
Merge pull request #948 from Okoyecb/patch-1
iliakan Apr 30, 2019
5e82fe2
Merge pull request #946 from javascript-tutorial/lex111-patch-2
iliakan Apr 30, 2019
19196e3
Merge pull request #945 from javascript-tutorial/lex111-patch-1
iliakan Apr 30, 2019
6a5f14d
6-data-storage/02-localstorage: fix highlight
lex111 May 1, 2019
ca92aed
1-js/12-generators-iterators/2-async-iterators-generators: fix typo
lex111 May 1, 2019
feebafc
Fix typos
lex111 May 1, 2019
b457de1
Replace error string with template strings
rezyx May 1, 2019
ac39b06
Merge pull request #956 from rezyx/replace-strings-11/async/02-promis…
iliakan May 2, 2019
be9dbd7
Fixed typos in defer example
yuenm18 May 3, 2019
042ebed
Fixed typos in defer example (#958)
lex111 May 3, 2019
9405358
1-js/06-advanced-functions/10-bind: fix markup
lex111 May 3, 2019
5982afb
Fix GitHub casing
rezyx May 4, 2019
5e37dbd
Fix GitHub casing (#959)
lex111 May 4, 2019
047ffa2
Update article.md
iliakan May 4, 2019
1764ee3
Fixed a small typo
luc4leone May 4, 2019
1646a74
Merge pull request #960 from luc4leone/patch-1
iliakan May 4, 2019
05f4502
fixes
iliakan May 4, 2019
1ba420f
fixes
iliakan May 4, 2019
1e99f7d
fixes
iliakan May 5, 2019
2634131
minor
iliakan May 5, 2019
6e77e3a
improvements
iliakan May 5, 2019
3623a88
up
iliakan May 6, 2019
db4d0de
fixes
iliakan May 6, 2019
702362f
8-web-components/3-shadow-dom: fix typos
lex111 May 6, 2019
ed86221
fixes
iliakan May 6, 2019
de5059f
Fix GitHub casing (04-promise-error-handling/article.md
rezyx May 6, 2019
9e598e5
Regex: moved and deleted content from the "Patterns and flags".
luc4leone May 6, 2019
40074e0
Merge pull request #964 from rezyx/fix-github-casing
lex111 May 6, 2019
dd6a630
Update solution.md
quangnd May 7, 2019
b7d7007
minor
iliakan May 7, 2019
f7a97ec
Merge pull request #965 from luc4leone/regex-intro
iliakan May 7, 2019
42f1dba
Merge pull request #967 from quangnd/patch-1
iliakan May 7, 2019
83b40bc
minor
iliakan May 7, 2019
0e5f889
fixed typo
Zyranivia May 8, 2019
c17491f
Update article.md
deniolp May 8, 2019
c8ed6f1
Added missing punctuation.
Zyranivia May 8, 2019
eabfc56
fixed typo (#968)
lex111 May 8, 2019
d15186d
fix
iliakan May 9, 2019
1a13331
Merge pull request #970 from Zyranivia/patch-2
iliakan May 9, 2019
7f5008e
Merge pull request #969 from deniolp/deniolp-patch-1
iliakan May 9, 2019
5f9597d
fix
iliakan May 9, 2019
11b1671
fixes
iliakan May 9, 2019
2addc4c
Fix typo
sparkofreason May 9, 2019
b9714f1
fix
iliakan May 9, 2019
07e09f8
Update article.md
alienfernandez May 9, 2019
2035e46
minor
iliakan May 9, 2019
4dc4272
minor
iliakan May 9, 2019
8e251ab
explanations
iliakan May 10, 2019
06f9927
remove extra article
iliakan May 10, 2019
0c2ef14
Update article.md (localstorage)
gongzemin May 10, 2019
00a01ec
Update LocalStorage
gongzemin May 10, 2019
637e8c1
Update article.md (LocalStorage) (#975)
lex111 May 10, 2019
e3c0be4
Fix typo (#971)
lex111 May 10, 2019
668bdf7
Update article.md (#972)
lex111 May 10, 2019
2b44781
fixes
iliakan May 11, 2019
f8f3c94
fix
iliakan May 11, 2019
f8570ae
fixes
iliakan May 11, 2019
29a3c58
fixes
iliakan May 11, 2019
9be9616
license
iliakan May 11, 2019
8b9aaa7
minor
iliakan May 11, 2019
5f423c8
minor
iliakan May 11, 2019
fd43d91
minor
iliakan May 11, 2019
b45c5a3
Fix typos
lex111 May 12, 2019
e6ed86c
Update article.md
gartenfeld May 13, 2019
dd67ddd
Merge pull request #978 from gartenfeld/patch-1
iliakan May 13, 2019
bc7d43c
minor
iliakan May 13, 2019
25539ce
minor
iliakan May 13, 2019
928f42d
minor
iliakan May 13, 2019
0490fa2
Fix typos
lex111 May 13, 2019
383c3db
Fix typo
lex111 May 13, 2019
f5f31e8
Fix typo
lex111 May 13, 2019
899a3ce
fixes
iliakan May 14, 2019
9df9561
Order mismatch
him2312 May 14, 2019
e4288e4
minor
iliakan May 14, 2019
a956c4f
up
iliakan May 14, 2019
2c4cc64
up
iliakan May 15, 2019
c709aa1
up
iliakan May 15, 2019
4e079a5
Fix Typo (brewity to brevity)
gongzemin May 15, 2019
1072055
minor
iliakan May 15, 2019
89d81d3
Merge pull request #1 from javascript-tutorial/master
gongzemin May 15, 2019
0d2fc22
fix
iliakan May 15, 2019
c5fab43
Fix typo, so it actually does invoke the setter
CrazyTim May 15, 2019
d11039e
Merge pull request #981 from CrazyTim/CrazyTim-patch-1
iliakan May 15, 2019
bfb3819
Spelling mistake
him2312 May 15, 2019
c43c553
Merge pull request #984 from him2312/patch-3
iliakan May 15, 2019
44bae6a
Fix typo (brewity to brevity) (#980)
lex111 May 16, 2019
43f5821
added link to exist page
shamilDzhakeev May 16, 2019
b368f37
Use relative link
lex111 May 16, 2019
40a4e18
added link to exist page (#985)
lex111 May 16, 2019
d974090
fixes
iliakan May 16, 2019
39394b9
Changed "phrase" to "phase" for capture param
May 16, 2019
c5f4d5b
Changed "phrase" to "phase" for capture param (#987)
lex111 May 16, 2019
98d3962
minor
iliakan May 16, 2019
c52fd3e
Fix typo
lex111 May 16, 2019
55f599e
word correction (#989)
lex111 May 16, 2019
da3ba6a
closes #990
iliakan May 17, 2019
809cebc
closes #990
iliakan May 17, 2019
ee4a91e
fix
iliakan May 17, 2019
63ffc3d
Update article.md
developerdavo May 18, 2019
6bdaf20
Mobile Browser accessibility
him2312 May 18, 2019
a830dcc
Grammar
him2312 May 19, 2019
5e2a2a1
Grammar (#996)
lex111 May 19, 2019
f751b57
Fix typo in article.md (#993)
lex111 May 19, 2019
e7d6d4a
Merge pull request #995 from him2312/patch-5
iliakan May 19, 2019
dd106ba
class
iliakan May 19, 2019
00d8b63
minor
iliakan May 19, 2019
0f5e44e
Merge pull request #979 from him2312/patch-2
iliakan May 19, 2019
47c2d22
Update README.md
iliakan May 19, 2019
49264e2
minor
iliakan May 19, 2019
3e5db10
Fix a little typo.
May 19, 2019
b52dd6f
Fix a little typo. (#997)
lex111 May 19, 2019
5c6a3f0
fixes
iliakan May 19, 2019
f651e96
minor
iliakan May 19, 2019
d7834f2
Fixed an error in the 'An incomparable undefined' section. The value …
May 20, 2019
4ffbb3b
Grave accent
alfiya-udc May 20, 2019
2b804eb
minor
iliakan May 20, 2019
49aef00
fixes
iliakan May 20, 2019
6972b41
Merge pull request #999 from alfiya-udc/master
iliakan May 20, 2019
3ce2d96
Merge pull request #998 from GodAzaldin/master
iliakan May 20, 2019
6a1cccf
Some punctuation & sense ?
alfiya-udc May 21, 2019
7d6d436
minor
iliakan May 21, 2019
cfff5c1
minor
iliakan May 21, 2019
db32cd0
minor
iliakan May 21, 2019
7f1d5de
minor
iliakan May 21, 2019
a361825
Grave accent
alfiya-udc May 22, 2019
bdda1af
minor
iliakan May 23, 2019
9f7235d
minor
iliakan May 23, 2019
d421e02
Update article.md
maurodibert May 23, 2019
33e1243
change spelling
nabaraj May 23, 2019
df7800a
improvement
iliakan May 23, 2019
397ee9a
specifying the property inside Environment Record
Violet-Bora-Lee May 24, 2019
4594d12
update comment on sample code
Violet-Bora-Lee May 24, 2019
4d17a15
Merge pull request #1007 from Violet-Bora-Lee/patch-3
iliakan May 24, 2019
d8cc5c4
Merge pull request #1005 from nabaraj/patch-1
iliakan May 24, 2019
3a24b0a
Merge pull request #1006 from Violet-Bora-Lee/patch-2
iliakan May 24, 2019
4879734
Merge pull request #1004 from maurodibert/patch-47
iliakan May 24, 2019
c7ba283
typo
maurodibert May 25, 2019
2bc3aae
Merge pull request #1009 from maurodibert/patch-48
iliakan May 25, 2019
a2cb3c6
Update solution.md
maurodibert May 25, 2019
09db684
Merge pull request #1012 from maurodibert/patch-49
iliakan May 25, 2019
f8a00f4
Update solution.md
maurodibert May 25, 2019
3e6f2d0
Fix typos
KenjiI May 25, 2019
f0affb7
minor
iliakan May 25, 2019
a747a2c
delete wrong comment
T1mL3arn May 25, 2019
f10e34b
Merge pull request #1015 from T1mL3arn/patch-1
iliakan May 25, 2019
895b46a
Merge pull request #1014 from KenjiI/patch-3
iliakan May 25, 2019
9b03ee7
Merge pull request #1013 from maurodibert/patch-50
iliakan May 25, 2019
49fbecc
clear declarations
iliakan May 26, 2019
7df2a2a
Update article.md
maurodibert May 26, 2019
ebe532e
del redundant 'then'
T1mL3arn May 26, 2019
be235bc
Del redundant 'then' word (#1019)
lex111 May 26, 2019
4ac1def
Merge pull request #1016 from maurodibert/patch-51
iliakan May 26, 2019
fabf802
Update article.md
iliakan May 26, 2019
5c6a8ec
minor
iliakan May 26, 2019
5f095cc
improvements
iliakan May 26, 2019
c4f6b24
fix css comments
T1mL3arn May 27, 2019
297ae60
Change number of flags
vasilevx May 27, 2019
a9a0156
Merge pull request #1021 from vasilevx/patch-2
iliakan May 27, 2019
feebcc8
Merge pull request #1020 from T1mL3arn/master
iliakan May 27, 2019
0641d55
Fix typo
lex111 May 28, 2019
50d7cc2
minor
iliakan May 28, 2019
878ce62
Update article.md
tonchique May 28, 2019
5a91716
Update article.md
tonchique May 28, 2019
56365ae
minor
iliakan May 28, 2019
ae776d8
Fix Websocket article typo
skmetaly May 28, 2019
9adabf8
Merge pull request #1024 from skmetaly/fix-websocket-typo
iliakan May 28, 2019
fde93c9
Merge pull request #1023 from tonchique/patch-2
iliakan May 28, 2019
3dd9fb0
Merge pull request #1022 from tonchique/patch-1
iliakan May 28, 2019
16e7d07
Fix typos
lex111 May 29, 2019
0873473
minor
iliakan May 29, 2019
77ad4eb
Update article.md
tonchique May 30, 2019
e4300bb
Fix typo
DouglasMV May 30, 2019
8489afd
Update article.md
dhx-mike-palandra May 30, 2019
e1eb073
Fix chaters to chapters
sthamit7 May 31, 2019
39ea587
Merge pull request #1003 from alfiya-udc/master
iliakan May 31, 2019
49476f4
Merge pull request #1027 from DouglasMV/master
iliakan May 31, 2019
eb7e281
Merge pull request #1026 from tonchique/patch-3
iliakan May 31, 2019
267cf94
Merge pull request #1028 from dhx-mike-palandra/patch-1
iliakan May 31, 2019
ce863fe
Merge pull request #1029 from sthamit7/patch-1
iliakan May 31, 2019
0a58516
Update article.md
tonchique May 31, 2019
55ba660
Update article.md (#1030)
lex111 May 31, 2019
76b0616
improvements
iliakan May 31, 2019
9f4b8a5
minor
iliakan May 31, 2019
6713199
minor
iliakan May 31, 2019
389801a
minor
iliakan May 31, 2019
e4b2d76
Update article.md
dhx-mike-palandra May 31, 2019
d04805f
New V8 Blog address
raminrez Jun 1, 2019
8c96150
New V8 Blog address (#1035)
lex111 Jun 1, 2019
0e97922
fixes
iliakan Jun 1, 2019
c82abef
minor
iliakan Jun 1, 2019
b88b4dc
Merge pull request #1033 from dhx-mike-palandra/patch-2
iliakan Jun 1, 2019
7067d62
Fix typo
segayuu Jun 3, 2019
c4593f1
Merge pull request #1036 from segayuu/patch-1
iliakan Jun 3, 2019
13bd321
Update article.md
tonchique Jun 3, 2019
c92f626
fixes
iliakan Jun 3, 2019
a0266c5
Update article.md (#1037)
lex111 Jun 3, 2019
6434aee
merging all conflicts
Jun 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
92 changes: 92 additions & 0 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# JavaScript 简介

<<<<<<< HEAD
我们一起来聊一下 JavaScript,用它能做什么,它有哪些特性,以及一些跟它配合使用的技术。
=======
Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

## 什么是 JavaScript?

<<<<<<< HEAD
**JavaScript** 最初的目的是为了“**赋予网页生命**”。

这种编程语言我们称之为**脚本**。它们可以写在 HTML 中,在页面加载的时候会自动执行。
Expand Down Expand Up @@ -31,23 +36,64 @@ JavaScript 在刚诞生的时候,它的名字叫 “LiveScript”。但是因
上面这些很容易记忆,因为经常出现在网上关于开发的文章中。我们也会这样用。例如:某个新的功能,如果 JavaScript 引擎 V8 是支持的,那么我们可以认为这个功能在 Chrome 和 Opera 中可以正常运行。

```smart header="引擎是如何工作的?"
=======
*JavaScript* was initially created to *"make web pages alive"*.

The programs in this language are called *scripts*. They can be written right in a web page's HTML and run automatically as the page loads.

Scripts are provided and executed as plain text. They don't need special preparation or compilation to run.

In this aspect, JavaScript is very different from another language called [Java](https://en.wikipedia.org/wiki/Java_(programming_language)).

```smart header="Why <u>Java</u>Script?"
When JavaScript was created, it initially had another name: "LiveScript". But Java was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.

But as it evolved, JavaScript became a fully independent language with its own specification called [ECMAScript](http://en.wikipedia.org/wiki/ECMAScript), and now it has no relation to Java at all.
```

Today, JavaScript can execute not only in the browser, but also on the server, or actually on any device that has a special program called [the JavaScript engine](https://en.wikipedia.org/wiki/JavaScript_engine).

The browser has an embedded engine sometimes called a "JavaScript virtual machine".

Different engines have different "codenames". For example:

- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
- ...There are other codenames like "Trident" and "Chakra" for different versions of IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.

The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome and Opera.

```smart header="How do engines work?"
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

引擎很复杂,但是基本原理很简单。

1. 引擎(通常嵌入在浏览器中)读取(“解析”)脚本。
2. 然后将脚本转化(“编译”)为机器语言。
3. 然后就可以在机器上飞速的运行。

<<<<<<< HEAD
引擎会对流程中的每个阶段都进行优化。它甚至可以在运行时监视编译的脚本,分析数据流并根据这些对机器代码应用优化。最后,脚本会执行地非常快。
=======
The engine applies optimizations at each step of the process. It even watches the compiled script as it runs, analyzes the data that flows through it, and applies optimizations to the machine code based on that knowledge. When it's done, scripts run quite fast.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb
```

## 浏览器中的 JavaScript 能做什么 ?

<<<<<<< HEAD
现代的 JavaScript 是一种“安全”语言。它不提供对内存或 CPU 的底层访问,因为它最初是为浏览器创建的,不需要这些功能。

JavaScript 的能力依赖于它执行的环境。例如:[Node.js](https://wikipedia.org/wiki/Node.js) 允许 JavaScript 读写任意文件、执行网络请求等。

浏览器中的 JavaScript 可以完成所有和网页相关的操作、处理用户和 Web 服务器之间的交互。
=======
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or CPU, because it was initially created for browsers which do not require it.

JavaScript's capabilities greatly depend on the environment it's running in. For instance, [Node.js](https://wikipedia.org/wiki/Node.js) supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.

In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

例如,浏览器中的 JavaScript 可以完成下面这些事:

Expand All @@ -61,7 +107,11 @@ JavaScript 的能力依赖于它执行的环境。例如:[Node.js](https://wik

为了用户的(信息)安全,在浏览器中的 JavaScript 的能力是有限的。这样主要是为了阻止邪恶的网站获得或修改用户的私人数据。

<<<<<<< HEAD
这些限制的例子有:
=======
Examples of such restrictions include:
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

* 网页中的 JavaScript 不能读、写、复制及执行用户磁盘上的文件或程序。它没有直接访问操作系统的功能。

Expand All @@ -70,6 +120,7 @@ JavaScript 的能力依赖于它执行的环境。例如:[Node.js](https://wik
JavaScript 有很多方式和设备的照相机/麦克风交互,但是这些都需要提前获得用户的授权许可。所以,JavaScript 并不会偷偷地通过你的摄像头观察你,更不会把你的信息发送到[美国国家安全局](https://en.wikipedia.org/wiki/National_Security_Agency)。
- 不同的浏览器标签页之间基本彼此不相关。有时候,也会有一些关系。例如,通过 JavaScript 打开另外一个新的标签页。但即使在这种情况下,如果两个标签页打开的不是同一个网站(域名、协议或者端口任一不相同的网站),他们都不能够相互通信。

<<<<<<< HEAD
这就是“同源策略”。为了解决不同标签页交互的问题,两个同源的网站必须**都**包含一些特殊的 JavaScript 代码,才能够实现数据交换。

这个限制也是为了用户的信息安全。例如,用户打开的 `http://anysite.com` 网页的 JavaScript 不能访问 `http://gmail.com`(另外一个标签页打开的网页)也不能从那里窃取信息。
Expand All @@ -78,22 +129,45 @@ JavaScript 的能力依赖于它执行的环境。例如:[Node.js](https://wik
![](limitations.png)

浏览器环境外的 JavaScript 一般没有这些限制。例如服务端的 JavaScript 就没有这些限制。现代浏览器还允许通过 JavaScript 来安装浏览器插件或扩展,当然这也是在用户授权的前提下。
=======
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and contain a special JavaScript code that handles it. We'll cover that in the tutorial.

This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com` and steal information from there.
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.

![](limitations.png)

Such limits do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugin/extensions which may ask for extended permissions.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

## JavaScript 为什么与众不同?

至少有 **3** 件事值得一提:

```compare
<<<<<<< HEAD
+ 和 HTML/CSS 完全的集成。
+ 使用简单的工具完成简单的任务。
+ 被所有的主流浏览器支持,并且默认开启。
=======
+ Full integration with HTML/CSS.
+ Simple things are done simply.
+ Support by all major browsers and enabled by default.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb
```
JavaScript is the only browser technology that combines these three things.

<<<<<<< HEAD
满足这三条的浏览器技术也只有 JavaScript 了。

这就是为什么 JavaScript 与众不同!这也是为什么它是创建浏览器界面的最普遍的工具。

当然,学习一项新技术的时候,最好先看一下它的前景。所以,接下来我们继续讨论包括新语言和浏览器功能在内的现代趋势。
=======
That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.

While planning to learn a new technology, it's beneficial to check its perspectives. So let's move on to the modern trends affecting it, including new languages and browser abilities.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb


## 比 JavaScript “好” 的语言
Expand All @@ -104,18 +178,36 @@ JavaScript 的能力依赖于它执行的环境。例如:[Node.js](https://wik

所以,最近出现了很多不同的语言,这些语言在浏览器中执行之前,都会被**编译**(转化)成 JavaScript。

<<<<<<< HEAD
现代化的工具使得编译速度非常快速和透明,实际上允许开发人员使用另一种语言编写代码并将其自动转换为 JavaScript。
=======
Modern tools make the transpilation very fast and transparent, actually allowing developers to code in another language and auto-converting it "under the hood".
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

这些语言的例子有:

<<<<<<< HEAD
- [CoffeeScript](http://coffeescript.org/) 是 JavaScript 的语法糖,它语法简短,明确简洁。通常使用 Ruby 的人喜欢用。
- [TypeScript](http://www.typescriptlang.org/) 将注意力集中在增加严格的数据类型。这样就能简化开发,也能用于开发复杂的系统。TypeScript 是微软开发的。
- [Dart](https://www.dartlang.org/) 是一门独立的语言。它拥有自己的引擎用于在非浏览器环境中运行(如:在手机应用中运行)。最开始是 Google 提供的用于替代 JavaScript 的,但是现在,它和其他上述的语言一样,浏览器也要求它被编译成 JavaScript 。

当然,还有更多其他的语言。即使我们在使用这些语言,我们也需要知道 JavaScript。因为学习 JavaScript 可以让我们真正明白我们自己在做什么。
=======
- [CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
- [TypeScript](http://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps). It was initially offered by Google as a replacement for JavaScript, but as of now, browsers require it to be transpiled to JavaScript just like the ones above.

There are more. Of course, even if we use one of these languages, we should also know JavaScript to really understand what we're doing.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

## 总结

<<<<<<< HEAD
- JavaScript 最开始是为浏览器设计的一门语言,但是现在也可以在其它的环境中运行。
- 现在,JavaScript 是一门在浏览器中使用最广、并且能够很好集成 HTML/CSS 的语言。
- 有很多其他的语言可以编译成 JavaScript,这些语言还提供更多的功能。最好要了解一下这些语言,至少需要在掌握 JavaScript 之后简单地看一下。
=======
- JavaScript was initially created as a browser-only language, but is now used in many other environments as well.
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration with HTML/CSS.
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb
Binary file modified 1-js/01-getting-started/1-intro/limitations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 1-js/01-getting-started/1-intro/limitations@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions 1-js/01-getting-started/2-code-editors/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

程序员接触时间最长的就是代码编辑器(后面简称编辑器)。

<<<<<<< HEAD
编辑器主要分两种:IDE(集成开发环境)和轻量编辑器。很多人喜欢这两种各选一个。

## IDE
Expand All @@ -19,38 +20,83 @@ IDE 加载项目(通常包含多个文件),并且允许在不同文件之
除了 Visual Studio,以上这些 IDE 都是跨平台的。Visual Studio 无法在 Linux 上使用。

大多数 IDE 是收费的,但是他们都可以试用。这些费用对于一个合格的程序员的薪水来说,肯定算不了什么,所以去选一个对你来说最好的吧。
=======
There are two main types of code editors: IDEs and lightweight editors. Many people use one tool of each type.

## IDE

The term [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) refers to a powerful editor with many features that usually operates on a "whole project." As the name suggests, it's not just an editor, but a full-scale "development environment."

An IDE loads the project (which can be many files), allows navigation between files, provides autocompletion based on the whole project (not just the open file), and integrates with a version management system (like [git](https://git-scm.com/)), a testing environment, and other "project-level" stuff.

If you haven't selected an IDE yet, consider the following options:

- [WebStorm](http://www.jetbrains.com/webstorm/) for frontend development. The same company offers other editors for other languages (paid).
- [Netbeans](http://netbeans.org/) (free).

All of these IDEs are cross-platform.

For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code." "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. A free version of it is called [Visual Studio Community](https://www.visualstudio.com/vs/community/).

Many IDEs are paid but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose the best one for you.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

## 轻量编辑器

“轻量编辑器”没有 IDE 那么功能强大,但是他们一般很快、优雅而且简单。

<<<<<<< HEAD
“轻量编辑器”主要用于立即打开编辑一个文件。
=======
They are mainly used to open and edit a file instantly.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

“轻量编辑器”和 IDE 有很大的区别。IDE 一般是项目中使用,就意味着一开始要加载很多数据,并且在使用的过程中会分析项目的结构和内容。如果我们只需要编辑一个文件,那么 “轻量编辑器” 会更快的帮我们打开文件。

实际上,“轻量编辑器”一般都有各种各样的插件,这些插件可以做语法分析和补全代码。所以“轻量编辑器”和 IDE 也没有严格的界限。

下面是一些流行的“轻量编辑器”:

<<<<<<< HEAD
- [Visual Studio Code](https://code.visualstudio.com/)(跨平台、免费)。
- [Atom](https://atom.io/)(跨平台、免费)。
- [Sublime Text](http://www.sublimetext.com)(跨平台、共享软件)。
- [Notepad++](https://notepad-plus-plus.org/)(Windows、免费)。
- [Vim](http://www.vim.org/) 和 [Emacs](https://www.gnu.org/software/emacs/) 很棒,前提是如果你知道怎么用。
=======
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free) also has many IDE-like features.
- [Atom](https://atom.io/) (cross-platform, free).
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

## 我的最爱

我个人喜好是同时拥有项目级别的 IDE 和轻量级的编辑器,以便快速轻松地进行文件编辑。

我使用的编辑器:

<<<<<<< HEAD
- 使用 [WebStorm](http://www.jetbrains.com/webstorm/) 写 JavaScript,如果项目涉及其他语言我切换到上面列出的其他 Jetbrains 产品之一。
- 轻量编辑器 —— [Sublime Text](http://www.sublimetext.com) 或 [Atom](https://atom.io/)。
=======
- As an IDE for JS -- [WebStorm](http://www.jetbrains.com/webstorm/) (I switch to one of the other JetBrains offerings when using other languages)
- As a lightweight editor -- [Sublime Text](http://www.sublimetext.com) or [Atom](https://atom.io/).
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

## 不要争吵

<<<<<<< HEAD
上面列表中的编辑器都是我或我的朋友(他们都是我认为很优秀的开发人员)已经使用了很长时间并且很满意的。
=======
The editors in the lists above are those that either I or my friends whom I consider good developers have been using for a long time and are happy with.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb

世上还有很多其他的很好的编辑器,你们可以选择一个自己最喜欢的。

<<<<<<< HEAD
选择编辑器就像选择其他工具一样。要看你的项目,以及个人的习惯、喜好。
=======
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
>>>>>>> a0266c574c0ab8a0834dd38ed65e7e4ee27f9cdb
Loading