Skip to content

Sync with upstream @ 08734734 #5

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 806 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
806 commits
Select commit Hold shift + click to select a range
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
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
oonufrienko 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
7d6d436
minor
iliakan May 21, 2019
cfff5c1
minor
iliakan May 21, 2019
db32cd0
minor
iliakan May 21, 2019
7f1d5de
minor
iliakan May 21, 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
d33a34f
merging all conflicts
iliakan May 30, 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
  •  
  •  
  •  
53 changes: 28 additions & 25 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 run automatically as the page loads.
>>>>>>> 08734734021aa128c13da2382fe8fa062677bb9f

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 @@ -70,14 +74,14 @@ The examples of such restrictions are:
There are ways to interact with camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other if they come from different sites (from a different domain, protocol or port).

This is called the "Same Origin Policy". To work around that, *both pages* must contain a special JavaScript code that handles data exchange.
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.

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