Skip to content

Sync with upstream @ 19223ae7 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 620 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
620 commits
Select commit Hold shift + click to select a range
29292c1
minor
iliakan Mar 13, 2019
943c971
minor
iliakan Mar 13, 2019
00b356c
refactor xhr
iliakan Mar 14, 2019
e882e72
fix
iliakan Mar 14, 2019
c7645b8
fix
iliakan Mar 14, 2019
93b87d3
fix
iliakan Mar 14, 2019
d5b9b89
fix
iliakan Mar 14, 2019
5daae78
fix
iliakan Mar 14, 2019
9fb235a
fix
iliakan Mar 14, 2019
5de1662
fix
iliakan Mar 14, 2019
440f408
fix
iliakan Mar 14, 2019
43626f7
Update article.md
Mar 14, 2019
66fa857
fetch draft
iliakan Mar 15, 2019
61ed067
Added a space after "for"
yifeiyin Mar 16, 2019
7f9851e
Merge pull request #1 from yifeiyin/master
yifeiyin Mar 16, 2019
37241b6
fetch
iliakan Mar 16, 2019
7f9a1e2
up
iliakan Mar 16, 2019
b1db8c0
Update article.md
ofcRS Mar 17, 2019
ac74268
Update article.md
ofcRS Mar 17, 2019
973f97c
binary draft
iliakan Mar 17, 2019
7d83a1a
Update article.md
Senseinvader Mar 17, 2019
ef81c0e
Update article.md
Senseinvader Mar 17, 2019
68d1ac1
drafts
iliakan Mar 18, 2019
31f83a5
network draft
iliakan Mar 18, 2019
1a54a9e
Fix Typo
iamplugged Mar 19, 2019
c47a379
a bug (Maximum call stack size exceeded)
helloendoftheworld Mar 19, 2019
4ffd79e
up
iliakan Mar 20, 2019
b716980
minor
iliakan Mar 20, 2019
3fea520
minor
iliakan Mar 20, 2019
2bcbbfc
up
iliakan Mar 20, 2019
855f67f
up
iliakan Mar 20, 2019
a420755
Merge pull request #837 from maurodibert/patch-40
iliakan Mar 20, 2019
caaaf0d
Merge pull request #863 from iamplugged/patch-1
iliakan Mar 20, 2019
bb33dcd
Merge pull request #861 from SherifGhoz/SherifGhoz-patch-1
iliakan Mar 20, 2019
4d35fe5
Merge pull request #859 from Senseinvader/patch-2
iliakan Mar 20, 2019
f67d7ad
Merge pull request #858 from Senseinvader/patch-1
iliakan Mar 20, 2019
5791f59
Merge pull request #857 from ofcRS/patch-2
iliakan Mar 20, 2019
fa5ace4
Merge pull request #856 from ofcRS/patch-1
iliakan Mar 20, 2019
1ae4d45
Merge pull request #854 from Baelx/patch-1
iliakan Mar 20, 2019
66b5039
Merge pull request #853 from RazvanBugoi/master
iliakan Mar 20, 2019
26839ee
Merge pull request #850 from James868/patch-2
iliakan Mar 20, 2019
7f4040a
Merge pull request #849 from James868/patch-1
iliakan Mar 20, 2019
4dcb97c
Merge pull request #848 from yifeiyin/patch-1
iliakan Mar 20, 2019
229a18f
Merge pull request #847 from georgesolomos/fix-broken-link
iliakan Mar 20, 2019
482dd2b
Merge pull request #846 from amslezak/patch-1
iliakan Mar 20, 2019
75dd9c8
Merge pull request #845 from vitorfurlin/patch-1
iliakan Mar 20, 2019
0166f1d
Merge pull request #841 from aiyayayaya/patch-1
iliakan Mar 20, 2019
cdb0a69
Merge pull request #840 from carlinmack/patch-1
iliakan Mar 20, 2019
5ab51a3
Merge pull request #839 from agdillon/master
iliakan Mar 20, 2019
1985d1c
Merge pull request #844 from aiyayayaya/patch-2
iliakan Mar 20, 2019
e42e8d9
Update article.md
mb1047 Mar 20, 2019
3b06ab3
ws draft
iliakan Mar 20, 2019
37f50d8
websocket
iliakan Mar 21, 2019
591b5f7
Update article.md
avinashsinghdhillon Mar 22, 2019
8998389
Update article.md
odykyi Mar 22, 2019
ffb9ce2
up
iliakan Mar 22, 2019
8489679
minor
iliakan Mar 22, 2019
e202ec2
edits
iliakan Mar 22, 2019
439cf4c
improvements
iliakan Mar 22, 2019
b8d63d3
improvements
iliakan Mar 22, 2019
50bee36
improvements
iliakan Mar 22, 2019
92f7f1b
fixes
iliakan Mar 22, 2019
706b1f2
fixes
iliakan Mar 22, 2019
db55cf7
Update to improve clarity and avoid confusion.
gargakshat Mar 23, 2019
323de66
Fix typo
rizkyzhang Mar 26, 2019
69aaf57
Fix typos
jessuni Mar 26, 2019
da51ce5
Fix English typo
ekqvist Mar 26, 2019
0873d43
up
iliakan Mar 26, 2019
260bca1
Update article.md
maurodibert Mar 28, 2019
1c8e98c
The previous link was DEPRECATED
EdThePro101 Mar 28, 2019
cae79b5
Fix function parameter
vasilevx Mar 29, 2019
65671ab
draft
iliakan Mar 30, 2019
9c3ac13
draft
iliakan Mar 30, 2019
8de6fa6
draft
iliakan Mar 30, 2019
a9fb779
Small Grammatical Error
LordLexLutheran Mar 30, 2019
79324d0
draft
iliakan Mar 30, 2019
304d578
up
iliakan Mar 31, 2019
7c3df46
Update article.md
overken Apr 1, 2019
da9d344
Update article.md
overken Apr 1, 2019
e4a1148
Merge pull request #866 from mb1047/patch-1
iliakan Apr 2, 2019
69c7491
Merge pull request #867 from avinashsinghdhillon/patch-1
iliakan Apr 2, 2019
956be1b
Merge pull request #868 from odykyi/patch-1
iliakan Apr 2, 2019
64ffd43
Merge pull request #886 from overken/patch-2
iliakan Apr 2, 2019
e9be10d
Merge pull request #885 from overken/patch-1
iliakan Apr 2, 2019
8925505
Merge pull request #882 from LordLexLutheran/patch-1
iliakan Apr 2, 2019
7fa1bf7
Merge pull request #880 from vasilevx/patch-1
iliakan Apr 2, 2019
0535487
Merge pull request #878 from Edwin-Pratt/patch-1
iliakan Apr 2, 2019
a8be18d
Merge pull request #876 from maurodibert/patch-44
iliakan Apr 2, 2019
8006d3c
Merge pull request #874 from Supernaiivi/typos
iliakan Apr 2, 2019
6d11147
Merge pull request #873 from jessuni/patch-2
iliakan Apr 2, 2019
184f7ae
Merge pull request #872 from James868/patch-3
iliakan Apr 2, 2019
6fb4aab
components
iliakan Apr 2, 2019
e22e971
Merge branch 'refactor'
iliakan Apr 2, 2019
3dbe87a
minor
iliakan Apr 2, 2019
9dff4c0
Merge pull request #870 from gargakshat/patch-1
iliakan Apr 2, 2019
911f783
minor
iliakan Apr 2, 2019
1932bfb
Typo in article.md
srogalsky8 Apr 2, 2019
94d30ce
Fix another typo
srogalsky8 Apr 2, 2019
85a0449
Merge pull request #1 from srogalsky8/master
srogalsky8 Apr 2, 2019
f19495e
Update article.md
overken Apr 3, 2019
a649079
More typos
srogalsky8 Apr 3, 2019
374bd26
Merge pull request #887 from srogalsky8/patch-1
iliakan Apr 3, 2019
2c0c69e
Merge pull request #888 from overken/patch-3
iliakan Apr 3, 2019
d7d1c17
todo
iliakan Apr 3, 2019
b5a531a
change it's to its
dagolinuxoid Apr 4, 2019
34fd31c
Update article.md
jackpickus Apr 5, 2019
2a39ef8
minor
iliakan Apr 5, 2019
8f13d61
Sketch editor update (no important image changes)
iliakan Apr 5, 2019
e3e4502
Mistake in naming the property name.
amolpatravali97 Apr 8, 2019
0789e38
Update README.md
iliakan Apr 8, 2019
798840e
promise result exact string match
holub008 Apr 8, 2019
b4053e1
Fix typo
jtlx Apr 8, 2019
9ad3206
typo fix
AdamDemirel Apr 8, 2019
1411881
Fix typo of 'Fetch: Abort'
Apr 9, 2019
18e30f1
Update article.md
Hormozdi Apr 9, 2019
1728f97
Fixing the syntax typo in prompt
atulsm Apr 9, 2019
d25d29c
Update article.md
atulsm Apr 9, 2019
16deb3c
General grammar/typo changes
elitree Apr 9, 2019
dfcba54
Merge pull request #889 from dagolinuxoid/fix-typo
iliakan Apr 9, 2019
6761dac
Merge pull request #901 from elitree/master
iliakan Apr 9, 2019
88c371a
Merge pull request #900 from atulsm/master
iliakan Apr 9, 2019
6190863
Merge pull request #899 from Hormozdi/master
iliakan Apr 9, 2019
8c6eb6e
Merge pull request #898 from liufei/master
iliakan Apr 9, 2019
b581d2c
Merge pull request #897 from brasscapon/patch-1
iliakan Apr 9, 2019
bcf8239
Merge pull request #896 from jtlx/patch-1
iliakan Apr 9, 2019
67ed0e0
Merge pull request #895 from holub008/master
iliakan Apr 9, 2019
1349e70
Merge pull request #894 from amolpatravali97/patch-1
iliakan Apr 9, 2019
c9631a1
Merge pull request #890 from jackpickus/patch-1
iliakan Apr 9, 2019
cf8218a
Update README.md
iliakan Apr 10, 2019
f979c09
Update README.md
iliakan Apr 10, 2019
7a38c1d
Update README.md
iliakan Apr 10, 2019
b7c77df
Update README.md
iliakan Apr 10, 2019
a72ee1d
Update README.md
iliakan Apr 10, 2019
4f925a1
Readme
iliakan Apr 10, 2019
222c52f
minor
iliakan Apr 10, 2019
726d7d5
fix
iliakan Apr 10, 2019
23d77ee
fix
iliakan Apr 10, 2019
c186ed8
Update README.md
iliakan Apr 10, 2019
c4b2a2f
Update README.md
iliakan Apr 10, 2019
7b6b40e
Type in 22-regexp-sticky/article.md
HaydenLobry Apr 11, 2019
7a9a83e
typos and improved wording
Apr 11, 2019
b362191
style
iliakan Apr 11, 2019
326bb84
Update style-guide.md
iliakan Apr 11, 2019
892c56a
up
iliakan Apr 11, 2019
3b97c0a
Change "water" to "value" parameter in sample
vasilevx Apr 11, 2019
271129e
Change link destination
kolumb Apr 13, 2019
24d132b
Minor grammatical typo fix
dragonwocky Apr 14, 2019
6d0fe48
Merge pull request #903 from HaydenLobry/patch-1
iliakan Apr 14, 2019
dda595e
Merge pull request #904 from tobycheese/typos_wording
iliakan Apr 14, 2019
7c4e330
Merge pull request #906 from vasilevx/patch-1
iliakan Apr 14, 2019
5c97087
Merge pull request #907 from kolumb/patch-2
iliakan Apr 14, 2019
1d19bcb
Merge pull request #909 from dragonwocky/patch-1
iliakan Apr 14, 2019
4966420
Just remove a strange symbol
oshliaer Apr 14, 2019
7e59d4b
translate
iliakan Apr 14, 2019
d886f55
fix function signature
Apr 14, 2019
bfa672d
fix function signature in view
Apr 14, 2019
0254608
Merge pull request #911 from oshliaer/9_03_article_strange-symbol
iliakan Apr 14, 2019
2b985ee
Merge pull request #912 from Azatik1000/master
iliakan Apr 14, 2019
0a95d04
closes #908
iliakan Apr 15, 2019
effc64a
Update article.md
abdullah-manzoor-ba Apr 15, 2019
dc2da30
Update arguments order of `then`
neoarma Apr 15, 2019
5856120
Update article.md
abdullah-manzoor-ba Apr 15, 2019
c113522
smoothed over wording
dragonwocky Apr 16, 2019
52f899a
inheret -> inherit
dragonwocky Apr 16, 2019
8a9d97a
itselfs -> itself
dragonwocky Apr 16, 2019
81a37be
typos
dragonwocky Apr 16, 2019
4a29486
minor
iliakan Apr 16, 2019
d50fff0
Update TRANSLATION.md
iliakan Apr 16, 2019
e06c906
Update article.md
odax Apr 16, 2019
3f753a1
Merge pull request #917 from dragonwocky/patch-2
iliakan Apr 17, 2019
56b954a
Merge pull request #918 from odax/patch-1
iliakan Apr 17, 2019
f81fd00
Merge pull request #916 from misterabd/patch-2
iliakan Apr 17, 2019
27db301
Update article.md
iliakan Apr 17, 2019
e73bbce
Merge pull request #915 from neoarma/patch-1
iliakan Apr 17, 2019
eb43d82
Merge pull request #914 from misterabd/patch-1
iliakan Apr 17, 2019
a9d2176
popup
iliakan Apr 17, 2019
30f1dc4
abort
iliakan Apr 17, 2019
bc845fd
make wording clearer
dragonwocky Apr 17, 2019
92f2c7b
Update article.md
1van0v Apr 17, 2019
a3c66e0
Merge pull request #920 from 1van0v/patch-1
iliakan Apr 17, 2019
1f19fd8
Merge pull request #919 from dragonwocky/patch-3
iliakan Apr 17, 2019
ef91e09
Fixed syntax error / typo
candh Apr 17, 2019
17223e6
Update index.md
JohnMcGuinness Apr 17, 2019
a64fb26
fix
iliakan Apr 18, 2019
f776557
import typo
dragonwocky Apr 18, 2019
a63d623
vise -> vice
dragonwocky Apr 18, 2019
922170b
thee -> the
dragonwocky Apr 18, 2019
4f6864e
fix typo in article title
tadjik1 Apr 19, 2019
b6f0a67
Merge pull request #925 from tadjik1/patch-1
iliakan Apr 19, 2019
811491d
Update README.md
iliakan Apr 19, 2019
c62633c
Update README.md
iliakan Apr 19, 2019
b79ba7d
Update README.md
iliakan Apr 19, 2019
75c51cf
Update README.md
iliakan Apr 19, 2019
f3ea976
Update README.md
iliakan Apr 19, 2019
f6a7c12
Update README.md
iliakan Apr 19, 2019
becdb24
Update README.md
iliakan Apr 19, 2019
08fa870
Update README.md
iliakan Apr 19, 2019
df0c224
Update README.md
iliakan Apr 19, 2019
79f0463
Update README.md
iliakan Apr 19, 2019
557d170
Update solution.md
him2312 Apr 20, 2019
0697954
minor
iliakan Apr 20, 2019
65e805c
Minor grammar fix
mihansweatpants Apr 20, 2019
42ae87a
Fix typo
mihansweatpants Apr 20, 2019
f363b92
Fixed typo
alaabouayed Apr 20, 2019
3dbd493
Merge pull request #921 from candh/patch-1
iliakan Apr 21, 2019
de9f268
Merge pull request #922 from JohnMcGuinness/patch-1
iliakan Apr 21, 2019
333a00b
Merge pull request #924 from dragonwocky/patch-4
iliakan Apr 21, 2019
77581bc
Merge pull request #927 from him2312/patch-1
iliakan Apr 21, 2019
7b884bf
Merge pull request #928 from mihansweatpants/patch-1
iliakan Apr 21, 2019
0a2b817
Merge pull request #929 from mihansweatpants/patch-2
iliakan Apr 21, 2019
be9f48c
Merge pull request #930 from alaabouayed/patch-1
iliakan Apr 21, 2019
b8eb04d
classes: remove patterns
iliakan Apr 21, 2019
092f739
searching elements: make more modern
iliakan Apr 21, 2019
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
aad1ca8
merging all conflicts
iliakan Apr 26, 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
  •  
  •  
  •  
51 changes: 27 additions & 24 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,33 @@

*जावास्क्रिप्ट* को पहली बार *वेब पेजेस चलाने* के लिए बनाया गया था

<<<<<<< HEAD
इस भाषा में प्रोग्राम को *स्क्रिप्ट्स* कहा जाता है They can be written right in the HTML and executed automatically as the page loads.
=======
The programs in this language are called *scripts*. They can be written right in a web page's HTML and executed automatically as the page loads.
>>>>>>> 19223ae762f03cdff4e83f6f963f4f427af93847

Scripts are provided and executed as a plain text. They don't need a special preparation or a compilation to run.
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 language was very popular at that time, so it was decided that positioning a new language as a "younger brother" of Java would help.
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.
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.
```

At present, JavaScript can not only execute 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).
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".
The browser has an embedded engine sometimes called a "JavaScript virtual machine".

Different engines have different "codenames", for example:
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.
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?"

Expand All @@ -38,14 +42,14 @@ Engines are complicated. But the basics are easy.
2. Then it converts ("compiles") the script to the machine language.
3. And then the machine code runs, pretty fast.

The engine applies optimizations on every stage 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. At the end, scripts are quite fast.
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.
```

## What can in-browser JavaScript do?

The 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.
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.

The capabilities greatly depend on the environment that runs JavaScript. For instance, [Node.JS](https://wikipedia.org/wiki/Node.js) supports functions that allow JavaScript to read/write arbitrary files, perform network requests, etc.
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.

Expand All @@ -61,7 +65,7 @@ For instance, in-browser JavaScript is able to:

JavaScript's abilities in the browser are limited for the sake of the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.

The examples of such restrictions are:
Examples of such restrictions include:

- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS system functions.

Expand All @@ -72,12 +76,12 @@ The examples of such restrictions are:

This is called the "Same Origin Policy". To work around that, *both pages* must contain a special JavaScript code that handles data exchange.

The limitation is again for 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 safety limitations.
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 installing plugin/extensions which may get extended permissions.
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.

## What makes JavaScript unique?

Expand All @@ -86,14 +90,13 @@ There are at least *three* great things about JavaScript:
```compare
+ Full integration with HTML/CSS.
+ Simple things are done simply.
+ Supported by all major browsers and enabled by default.
+ Support by all major browsers and enabled by default.
```
JavaScript is the only browser technology that combines these three things.

Combined, these three things exist only in JavaScript and no other browser technology.
That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.

That's what makes JavaScript unique. That's why it's the most widespread tool to create 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 that include new languages and browser abilities.
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.


## Languages "over" JavaScript
Expand All @@ -108,14 +111,14 @@ Modern tools make the transpilation very fast and transparent, actually allowing

Examples of such languages:

- [CoffeeScript](http://coffeescript.org/) is a "syntactic sugar" for JavaScript, it introduces shorter syntax, allowing to write more precise and clear 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.
- [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 those languages, we should also know JavaScript, to really understand what we're doing.
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.

## Summary

- JavaScript was initially created as a browser-only language, but now it is used in many other environments as well.
- At this moment, JavaScript has a unique position as the most widely-adopted browser language with full integration with HTML/CSS.
- 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.
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/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 11 additions & 12 deletions 1-js/01-getting-started/2-code-editors/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@

A code editor is the place where programmers spend most of their time.

There are two archetypes: IDE and lightweight editors. Many people feel comfortable choosing one tool of each type.
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) means a powerful editor with many features that usually operates on a "whole project." As the name suggests, that's not just an editor, but a full-scale "development environment."
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 (can be many files), allows navigation between files, provides autocompletion based on the whole project (not just the open file), integrates with a version management system (like [git](https://git-scm.com/)), a testing environment and other "project-level" stuff.
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 considered selecting an IDE yet, look at the following variants:
If you haven't selected an IDE yet, consider the following options:

- [WebStorm](http://www.jetbrains.com/webstorm/) for frontend development and other editors of the same company if you need additional languages (paid).
- [Visual Studio Code](https://code.visualstudio.com/) (free).
- [Netbeans](http://netbeans.org/) (paid).
- [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 the IDEs are cross-platform.
All of these IDEs are cross-platform.

For Windows, there's also a "Visual Studio" editor, don't confuse it 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/).
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.

Expand All @@ -34,7 +33,7 @@ In practice, lightweight editors may have a lot of plugins including directory-l

The following options deserve your attention:

- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
- [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).
Expand All @@ -46,7 +45,7 @@ The personal preference of the author is to have both an IDE for projects and a

I'm using:

- [WebStorm](http://www.jetbrains.com/webstorm/) for JS, and if there is one more language in the project, then I switch to one of the other JetBrains offerings listed above.
- 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/).

## Let's not argue
Expand All @@ -55,4 +54,4 @@ The editors in the lists above are those that either I or my friends whom I cons

There are other great editors in our big world. Please choose the one you like the most.

The choice of an editor, like any other tool, is individual and depends on your projects, habits, personal preferences.
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
24 changes: 15 additions & 9 deletions 1-js/01-getting-started/3-devtools/article.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Developer console

Code is prone to errors. You are quite likely to make errors... Oh, what am I talking about? You are *absolutely* going to make errors, at least if you're a human, not a [robot](https://en.wikipedia.org/wiki/Bender_(Futurama)).
Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are *absolutely* going to make errors, at least if you're a human, not a [robot](https://en.wikipedia.org/wiki/Bender_(Futurama)).

But in the browser, a user doesn't see the errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it.
But in the browser, users don't see errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it.

To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers.

Most often developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most people have a "favorite" browser and switch to others if a problem is browser-specific.
Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific.

Developer tools are potent; there are many features. To start, we'll learn how to open them, look at errors and run JavaScript commands.
Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.

## Google Chrome

Expand All @@ -31,28 +31,34 @@ The exact look of developer tools depends on your version of Chrome. It changes

Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them (`key:Shift+Enter` to input multi-line commands).

Now we can see errors, and that's enough for a start. We'll be back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>.
Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>.


## Firefox, Edge, and others

Most other browsers use `key:F12` to open developer tools.

The look & feel of them is quite similar. Once you know how to use one of those tools (you can start with Chrome), you can easily switch to another.
The look & feel of them is quite similar. Once you know how to use one of these tools (you can start with Chrome), you can easily switch to another.

## Safari

Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first.

Open Preferences and go to "Advanced" pane. There's a checkbox at the bottom:
Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom:

![safari](safari.png)

Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options.

## Multi-line input

Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.

To insert multiple lines, press `key:Shift+Enter`.

## Summary

- Developer tools allow us to see errors, run commands, examine variables and much more.
- They can be opened with `key:F12` for most browsers under Windows. Chrome for Mac needs `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (need to enable first).
- Developer tools allow us to see errors, run commands, examine variables, and much more.
- They can be opened with `key:F12` for most browsers on Windows. Chrome for Mac needs `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (need to enable first).

Now we have the environment ready. In the next section, we'll get down to JavaScript.
Loading