Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3164 commits
Select commit Hold shift + click to select a range
8812070
"allows to" -> "allows us to" (2x)
paroche Feb 29, 2020
c039f04
Update article.md
leviding Feb 29, 2020
637088d
Remove useless spaces
alexgalkin Feb 29, 2020
fafee0e
Fix typo.
larryng Mar 1, 2020
4e04bcb
Merge pull request #6 from javascript-tutorial/master
aniketkudale Mar 1, 2020
c72cca8
minor fixes
iliakan Mar 1, 2020
4325537
corrected order for subtraction
zeel Mar 1, 2020
cf6821e
minor fixes
Violet-Bora-Lee Mar 1, 2020
4a15b96
Merge pull request #1783 from Violet-Bora-Lee/patch-1
iliakan Mar 1, 2020
fcfef6a
Merge pull request #1782 from zeel/patch-1
iliakan Mar 1, 2020
696eda5
fix typo
KuthumiPepple Mar 3, 2020
131c96e
fix: removed , from solution.md date data types
zeel Mar 7, 2020
8ae11cb
fix: removed , from task.md date data types
zeel Mar 7, 2020
79356bb
Merge pull request #7 from javascript-tutorial/master
aniketkudale Mar 7, 2020
76bf5ec
Corrected Grammar
aniketkudale Mar 9, 2020
3673751
Fix typo
lex111 Mar 10, 2020
3b48dee
Fix a typo
Mar 11, 2020
6ee0d97
Fix a typo
Mar 11, 2020
6917305
fix: 2 lines of russian to english and a typo (mathces -> matches)
HynekS Mar 11, 2020
61bd2b3
fix: fix markdown highlight
Mar 11, 2020
8a13b9b
Create index.html
leviding Mar 12, 2020
be02f57
Update index.html
leviding Mar 12, 2020
4df68f5
Update index.html
leviding Mar 12, 2020
44e88b8
Update solution.md
leviding Mar 12, 2020
07bd724
Update article.md
leviding Mar 13, 2020
958cbe7
minor fixes
Violet-Bora-Lee Mar 13, 2020
c116813
Merge pull request #1800 from Violet-Bora-Lee/master
iliakan Mar 14, 2020
b93cf9d
Minor statement change
Etheraex Mar 14, 2020
bfe8e3f
Update article.md
leviding Mar 19, 2020
94b9c9d
minor fixes
iliakan Mar 21, 2020
fe5d6d9
Merge pull request #1765 from u-n-known/patch-3
iliakan Mar 21, 2020
63518dc
Merge pull request #1770 from jorishr/patch-1
iliakan Mar 21, 2020
58d4329
Merge pull request #1771 from detinsley1s/patch-1
iliakan Mar 21, 2020
d9d2127
Merge pull request #1774 from duongdominhchau/patch-1
iliakan Mar 21, 2020
0d0908f
Merge pull request #1776 from YRFT/patch-1
iliakan Mar 21, 2020
4939a18
Merge pull request #1779 from leviding/patch-3
iliakan Mar 21, 2020
cf851b0
Merge pull request #1780 from alexgalkin/master
iliakan Mar 21, 2020
8211dfd
Merge pull request #1781 from larryng/patch-1
iliakan Mar 21, 2020
4995823
Merge pull request #1787 from KuthumiPepple/patch-1
iliakan Mar 21, 2020
81e728c
Merge pull request #1789 from zeel/patch-1
iliakan Mar 21, 2020
b7dc89a
closes #1791
iliakan Mar 21, 2020
d19401e
Merge pull request #1792 from aniketkudale/master
iliakan Mar 21, 2020
3c2b027
Merge pull request #1795 from zhang1pr/master
iliakan Mar 21, 2020
3086efe
Merge pull request #1796 from HynekS/fix-lang-and-typo
iliakan Mar 21, 2020
2526d5c
Merge pull request #1797 from xin-nie/xnie-fix-markdown
lex111 Mar 21, 2020
60d2e2f
Merge pull request #1804 from leviding/patch-6
lex111 Mar 21, 2020
4357ba9
fixes #1794
iliakan Mar 21, 2020
cec58f4
Merge pull request #1802 from Etheraex/master
iliakan Mar 21, 2020
4084746
Merge pull request #1799 from leviding/patch-5
iliakan Mar 21, 2020
d2ac997
Merge pull request #1798 from leviding/patch-4
iliakan Mar 21, 2020
6ec3f34
closes #1794
iliakan Mar 22, 2020
c866c46
Update solution.md
leviding Mar 22, 2020
a11cc18
Merge pull request #1807 from leviding/patch-4
iliakan Mar 22, 2020
460e7a8
Update article.md
leviding Mar 23, 2020
6700835
closes #1808
iliakan Mar 23, 2020
fd81db7
closes #1812
iliakan Mar 24, 2020
162280b
minor fixes
iliakan Mar 24, 2020
9900be9
Edit sentance syntax in closure article
Mar 24, 2020
b38e243
Update solution.md
leviding Mar 24, 2020
ab1b6de
formatting
KennethKinLum Mar 25, 2020
03aa504
Update article.md
leviding Mar 26, 2020
304ae1c
Update article.md
leviding Mar 26, 2020
da3303b
Update article.md
leviding Mar 27, 2020
0903209
fix typo
wonderingabout Mar 27, 2020
14cd9ec
Update article.md
leviding Mar 27, 2020
2efef24
Update article.md
leviding Mar 27, 2020
ab7a186
Update article.md
leviding Mar 28, 2020
35ff499
fix typo
baooab Mar 29, 2020
063bb96
Merge pull request #1829 from baooab/patch-6
lex111 Mar 29, 2020
be80c33
Merge pull request #1827 from leviding/patch-12
lex111 Mar 29, 2020
6d81d3d
Merge pull request #1826 from leviding/patch-11
lex111 Mar 29, 2020
8cf89b3
Merge pull request #1825 from wonderingabout/fix-typos
lex111 Mar 29, 2020
0895276
Merge pull request #1824 from leviding/patch-10
lex111 Mar 29, 2020
0c5d5d2
Merge pull request #1821 from leviding/patch-8
lex111 Mar 29, 2020
d6ad00f
Merge pull request #1815 from leviding/patch-5
lex111 Mar 29, 2020
c41b8bd
Update article.md
lex111 Mar 29, 2020
20351cb
Merge pull request #1822 from leviding/patch-9
lex111 Mar 29, 2020
c1c5c73
Merge pull request #1748 from GeorgySerga/patch-6
lex111 Mar 29, 2020
09a11ab
Merge pull request #1744 from qdflavel/typos-fix
lex111 Mar 29, 2020
ac5fd8c
Merge pull request #1820 from KennethKinLum/patch-12
lex111 Mar 29, 2020
f4cb058
trick get a new copy of objects/arrays using the spread operator
wonderingabout Mar 29, 2020
c038ef4
Merge pull request #1823 from wonderingabout/trick-deep-copy-spread
paroche Mar 29, 2020
aad6f5e
fix missing js formatting
wonderingabout Mar 29, 2020
42eadf9
Merge pull request #1814 from michael-mcgee/closure-article-edit
iliakan Mar 29, 2020
adfb099
Update article.md
iliakan Mar 29, 2020
62299ed
do the same => do the same thing
paroche Mar 29, 2020
eb546f0
Fixing "sum(1)" instead of "curriedSum(1)" (l. 42)
Aakodal Mar 30, 2020
46b3bf6
Change 'brackets' to 'parentheses'
paroche Mar 31, 2020
2a6e87a
Change 'brackets' to 'parentheses'
paroche Mar 31, 2020
8e22d3f
Update article.md
leviding Apr 1, 2020
6b5a524
fix an anchor link error
Ahmed-Magdy-S Apr 1, 2020
a223336
Update article.md
leviding Apr 2, 2020
dd0c195
Merge pull request #1839 from leviding/patch-2
iliakan Apr 2, 2020
fde6d43
Merge pull request #1838 from Ahmed-Magdy-S/patch-1
iliakan Apr 2, 2020
368cc06
Merge pull request #1837 from leviding/patch-1
iliakan Apr 2, 2020
cd2d450
Merge pull request #1834 from Aakodal/patch-1
iliakan Apr 2, 2020
5049c0b
Merge pull request #1830 from wonderingabout/add-js-formatting
iliakan Apr 2, 2020
6f45ce7
Merge pull request #1809 from leviding/patch-4
iliakan Apr 2, 2020
a55b99c
fixes #1836
iliakan Apr 2, 2020
d84673a
closes #1810
iliakan Apr 2, 2020
81a63cf
fix minor typo
Ahmed-Magdy-S Apr 2, 2020
0287fbd
Change switch Grouping of "case" example
SambaLim Apr 2, 2020
f33dc7e
Merge pull request #1841 from SambaLim/master
iliakan Apr 3, 2020
09404a0
Merge pull request #1840 from Ahmed-Magdy-S/patch-2
iliakan Apr 3, 2020
b82443d
Update article.md
leviding Apr 4, 2020
5a9b8a4
up
iliakan Apr 4, 2020
2acd258
minor fixes
iliakan Apr 4, 2020
23ffde7
minor fixes
iliakan Apr 4, 2020
59d791b
fix typo
baooab Apr 5, 2020
c89ddc5
Merge pull request #1751 from u-n-known/patch-1
iliakan Apr 5, 2020
ee69981
Update article.md
leviding Apr 6, 2020
ec9c76c
Update article.md
leviding Apr 9, 2020
1e092a8
Update article.md
leviding Apr 9, 2020
8090aa6
Update article.md
leviding Apr 9, 2020
2a01424
chapter -> article (3x)
paroche Apr 10, 2020
0bf13ec
Update article.md
leviding Apr 10, 2020
3ffab46
Update article.md
leviding Apr 11, 2020
71120d5
Various small wording and punctuation changes
paroche Apr 12, 2020
e8dcfd1
Update article.md
leviding Apr 13, 2020
37107f7
Merge pull request #1845 from baooab/patch-7
lex111 Apr 18, 2020
641dd56
delete extra content
baooab Apr 21, 2020
d65141d
That's a getter/setter for it -> It's a getter/setter for it
paroche Apr 22, 2020
00cc802
Remove unnecessary "to"
bryik Apr 26, 2020
ec9ae12
add break to number case
janina213 Apr 29, 2020
f2a099b
Merge pull request #1877 from janina213/patch-1
iliakan Apr 29, 2020
8564508
Merge pull request #1874 from bryik/patch-1
iliakan Apr 29, 2020
6ead9af
Merge pull request #1868 from baooab/patch-8
iliakan Apr 29, 2020
fbd6c8a
Merge pull request #1750 from galunni/patch-1
iliakan Apr 29, 2020
649ecc5
closes #1864
iliakan Apr 29, 2020
1d10422
Merge pull request #1861 from leviding/patch-11
iliakan Apr 29, 2020
2ae8261
Merge pull request #1858 from leviding/patch-10
iliakan Apr 29, 2020
2f61147
Merge pull request #1857 from leviding/patch-9
iliakan Apr 29, 2020
839e375
Merge pull request #1856 from leviding/patch-8
iliakan Apr 29, 2020
3543d6d
Merge pull request #1855 from leviding/patch-7
iliakan Apr 29, 2020
f0bd80c
Merge pull request #1853 from leviding/patch-6
iliakan Apr 29, 2020
ba88b60
closes #1852
iliakan Apr 29, 2020
e1469e3
Merge pull request #1847 from leviding/patch-5
iliakan Apr 29, 2020
889913d
Merge pull request #1844 from leviding/patch-3
iliakan Apr 29, 2020
da16159
trick: use array destructuring to swap variables
wonderingabout Apr 29, 2020
ef71488
Merge pull request #1859 from wonderingabout/trick-swap-variables
iliakan Apr 29, 2020
3a3086b
minor fixes
iliakan Apr 29, 2020
175aefa
minor fixes
iliakan Apr 30, 2020
9c2cb1b
Fix minor typo error
leviding May 1, 2020
29ac929
Fix typo in css-animations
traxium May 1, 2020
5a6be36
Updated to show Edge now supports BigInt
RyanAmeri May 1, 2020
8a13c99
Add nullish coalescing to multiple articles, refactor operators, renu…
iliakan May 2, 2020
0835b11
Update article.md
thediveshsoni May 2, 2020
e111aa1
minor improvements
iliakan May 2, 2020
09a964e
'somewhy' -> 'for some reason it'
paroche May 2, 2020
b057341
refactor objects, add optional chaining
iliakan May 3, 2020
c2ce2d4
minor fixes
iliakan May 4, 2020
a5f6a98
small phrase change
matjax May 4, 2020
a211fc9
Update article.md
rjlardizabal May 5, 2020
6853f6a
remove duplicate words
shubham08gupta May 5, 2020
ea39704
small phrase change 1.1
matjax May 5, 2020
fd45b7f
apostrophe
matjax May 5, 2020
b491097
minor fixes
Violet-Bora-Lee May 5, 2020
ac03836
Merge pull request #1888 from Violet-Bora-Lee/master
iliakan May 5, 2020
2289134
Merge pull request #1884 from matjax/master
paroche May 5, 2020
b782700
minor fixes
Violet-Bora-Lee May 6, 2020
405032e
Merge pull request #1890 from Violet-Bora-Lee/master
iliakan May 6, 2020
ba2b7b0
minor
iliakan May 6, 2020
cd5a7e4
fix debounce
iliakan May 6, 2020
80f2bec
fix debounce
iliakan May 6, 2020
844b96a
fix debounce
iliakan May 6, 2020
4584937
minor fixes
iliakan May 6, 2020
0444de2
minor fixes
iliakan May 6, 2020
3440a4e
minor fixes
iliakan May 6, 2020
df6f6be
minor fixes
iliakan May 6, 2020
fc2ba21
minor fixes
iliakan May 6, 2020
9bd640c
minor fixes
iliakan May 6, 2020
6cf15b7
minor fixes
iliakan May 6, 2020
08309a0
minor fixes
iliakan May 6, 2020
83c07e1
minor fixes
iliakan May 6, 2020
c799f28
minor fixes
iliakan May 6, 2020
6b927fc
fixing a typo on line 7
vin18 May 7, 2020
fe78701
fixing a typo on line 431
vin18 May 7, 2020
24224dc
Merge pull request #1893 from vin18/patch-2
iliakan May 7, 2020
f9ad719
Fix Typo in logical operators
mkawi May 8, 2020
e20b1a4
Adding missing 'pattern:'
Aakodal May 8, 2020
0bc8ab6
Fix a small text typo
pedrogpimenta May 8, 2020
62edeb7
Merge pull request #1896 from pedrogpimenta/patch-1
lex111 May 9, 2020
2f400a5
Merge pull request #1887 from shubham08gupta/patch-1
lex111 May 9, 2020
2bd28fe
Merge pull request #1881 from thediveshsoni/patch-1
lex111 May 9, 2020
ebd9a2c
Merge pull request #1878 from leviding/patch-12
lex111 May 9, 2020
681b4fd
Merge pull request #1891 from vin18/patch-1
lex111 May 9, 2020
3cefe91
Merge pull request #1885 from rjlardizabal/patch-1
lex111 May 9, 2020
4927d7a
Merge pull request #1895 from Aakodal/patch-2
lex111 May 9, 2020
681ef7b
Merge pull request #1879 from traxium/steps
lex111 May 9, 2020
a9e5ed5
minor rephrasings
iliakan May 9, 2020
db789a0
minor
iliakan May 9, 2020
6e1e244
pointer api
iliakan May 9, 2020
5d3aa7f
event.button
iliakan May 9, 2020
cca469b
renumber
iliakan May 9, 2020
c056a19
minor fixes
iliakan May 9, 2020
aabbec1
minor fixes
iliakan May 11, 2020
d9d1cfe
Add additional error type-checking examples and use `instanceof` in l…
mattbaker-digital May 15, 2020
befe535
Update task.md
wnleao May 16, 2020
ec77f84
grammar fix: a plain object
wnleao May 16, 2020
c331e44
Merge pull request #1880 from RyanAmeri/master
iliakan May 17, 2020
8a0058d
closes #1882
iliakan May 17, 2020
9353a04
Merge pull request #1894 from mKawi/patch-1
iliakan May 17, 2020
b18ae20
closes #1897
iliakan May 17, 2020
7ef7c5e
Merge pull request #1903 from mattbaker-digital/master
iliakan May 17, 2020
da1d600
minor fixes
iliakan May 17, 2020
c9d84ac
Merge pull request #1905 from kiniggit/master
iliakan May 17, 2020
873e5f7
Merge pull request #1908 from kiniggit/map_set_grammar
iliakan May 17, 2020
fef45af
correct minor error
ZYinMD May 18, 2020
fc8efbf
closes #1909
iliakan May 18, 2020
6c6d5a4
minor fixes
iliakan May 18, 2020
14eb62c
minor fixes
iliakan May 18, 2020
7fc037f
minor fixes
iliakan May 18, 2020
787409b
correct minor error: "имя" is used in place of "name"
ZYinMD May 19, 2020
4e67c0f
Remove duplicate word "soon"
desevoker May 19, 2020
4267d22
minor fixes
iliakan May 21, 2020
77cb06d
Fixed a comment, to reflect changes in the task.
Logan-Schelly May 21, 2020
333cb9d
Fixed minor typos
Logan-Schelly May 21, 2020
bdd936f
fixed grammar
May 23, 2020
3889038
Merge pull request #1912 from ZYinMD/patch-1
iliakan May 23, 2020
43a2b02
Merge pull request #1914 from ZYinMD/patch-2
iliakan May 23, 2020
e7e0fc8
Merge pull request #1915 from desevoker/patch-1
iliakan May 23, 2020
3623cc2
Merge pull request #1917 from Logan-Schelly/master
iliakan May 23, 2020
0da5b2b
Merge pull request #1920 from ekira/patch-1
iliakan May 23, 2020
8613348
Fix typo
GabrieleC May 23, 2020
46daea1
Details on cross-origin requests & credentials
ironsoul0 May 25, 2020
4fe42dd
fixed typos
kumarvaibhav45 May 26, 2020
9141a27
Merge pull request #1922 from GabrieleC/master
iliakan May 27, 2020
e1b44e8
Merge pull request #1927 from kumarvaibhav45/patch-1
iliakan May 27, 2020
4a22c98
Merge pull request #1926 from ironsoul0/patch-1
iliakan May 27, 2020
8c5fa3a
minor fixes
iliakan May 27, 2020
d36675e
minor fixes
iliakan May 27, 2020
cd2c7ce
minor
iliakan May 28, 2020
fef7155
google js guide link
tiagocastro070 May 28, 2020
075266e
Update article.md
lex111 May 30, 2020
69e4450
minor fixes
iliakan May 31, 2020
ad0a5b3
Fix for Issue #1866
tmollov May 31, 2020
479c7f9
fixes #1935
iliakan Jun 1, 2020
8f2ae7e
fixes #1931
iliakan Jun 1, 2020
9cb597e
minor fixes
iliakan Jun 1, 2020
ab93cee
minor fixes
iliakan Jun 1, 2020
d6a3bd1
minor fixes
iliakan Jun 1, 2020
5cd1314
minor fixes
iliakan Jun 1, 2020
1b2a192
minor fixes
iliakan Jun 1, 2020
a701341
Merge pull request #1932 from tmollov/master
iliakan Jun 1, 2020
7b59734
typo
iliakan Jun 1, 2020
ecfcff2
Merge pull request #1928 from tiagocastro070/google-js-guide
iliakan Jun 1, 2020
76bc708
remove a stray 's' that caused an error in ball drag example
syncopika Jun 6, 2020
020f2ea
Merge pull request #1946 from syncopika/master
iliakan Jun 6, 2020
d35baee
closes #1949
iliakan Jun 7, 2020
db47ec3
merging all conflicts
iliakan Jun 8, 2020
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
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf
*.svg binary
95 changes: 95 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.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8

## JavaScript とは?

<<<<<<< HEAD
*JavaScript* は当初 *"Webページを活かすため"* に作られました。

この言語のプログラムは *スクリプト* と呼ばれます。それらはHTMLの中に書かれ、ページが読み込まれると自動的に実行されます。
Expand Down Expand Up @@ -31,23 +36,64 @@ JavaScript が作られたとき, 当初は別の名前を持っていました:
これらの用語は、インターネット上の開発者の記事で使用されているため、覚えておくと良いでしょう。 たとえば、"ある機能 X が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 is it called <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?"
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8

エンジンは複雑ですが、基本は単純です。

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 further optimizes the machine code based on that knowledge.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8
```

## ブラウザ内のJavaScriptができることは?

<<<<<<< HEAD
モダンなJavaScriptは "安全な" プログラミング言語です。それは、メモリやCPUのような低レベルのアクセスは提供しません。なぜなら、当初はそれらを必要としないブラウザ用に作成されたものだからです。

JavaScript の機能は、実行される環境に大きく依存します。 例えば、[Node.JS](https://wikipedia.org/wiki/Node.js) では、JavaScriptが任意のファイルを読み書きしたりできる機能をサポートしています。

ブラウザ内のJavaScriptは、Webページの操作、ユーザや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.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8

たとえば、ブラウザ内のJavaScriptは次のようなことが可能です:

Expand All @@ -60,15 +106,22 @@ JavaScript の機能は、実行される環境に大きく依存します。

## ブラウザ内のJavaScriptで出来ないことは?

<<<<<<< HEAD
ブラウザでは、JavaScriptの機能はユーザの安全のために制限されています。
その目的は、悪意のあるWebページがプライベートな情報へアクセスしたり、ユーザデータへ危害を加えることを防ぐことです。

制限の例として、次のようなものがあります:
=======
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 functions.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8

- Webページ上のJavaScriptは、ハードディスク上の任意のファイルの読み書きや、それらのコピー、プログラムの実行をすることができません。OSのシステム機能に直接アクセスすることはできません。

現代のブラウザは、ファイルを扱うことはできますがアクセスは制限されており、ブラウザウィンドウへのファイルの "ドロップ" や、`<input>` タグを経由したファイル選択と言ったユーザの特定の操作のみを提供しています。

<<<<<<< HEAD
カメラ/マイクやその他デバイスとやり取りする方法はありますが、ユーザの明示的な許可が求められます。したがって、JavaScriptが有効なページがWebカメラを密かに有効にしたり、それを利用して利用者の周囲を観察したり、[NSA](https://en.wikipedia.org/wiki/National_Security_Agency) に情報を送信すると言ったことはできません。
- 異なるタブやウィンドウは一般的にお互いについて知りません。時々、例えばあるウィンドウがJavaScriptを利用して別のウィンドウを開くケースはあります。しかし、この場合においても、あるページからのJavaScriptは、別のサイト(異なるドメイン、プロトコル、ポート)からのものである場合は、アクセスすることはできません。

Expand All @@ -78,6 +131,16 @@ JavaScript の機能は、実行される環境に大きく依存します。
- JavaScriptはネットワークを介して、現在のページがきたサーバと簡単にやり取りすることができます。しかし、他のサイト/ドメインからデータを受信することは制限されています。可能ですが、リモート側からの明示的な同意(HTTPヘッダで表現)が必要になります。繰り返しますが、これらは安全上の制限です。

![](limitations.svg)
=======
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.svg)

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

JavaScriptがブラウザ外で使われる場合はこのような制限は存在しません。たとえば、サーバ上です。また、現代のブラウザは、より拡張されたアクセス権限を必要とするプラグイン/拡張機能を利用することもできます。

Expand All @@ -86,17 +149,30 @@ JavaScriptがブラウザ外で使われる場合はこのような制限は存
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.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8
```
JavaScript is the only browser technology that combines these three things.

<<<<<<< HEAD
これら3つの事柄はJavaScript特有のことであり、他のブラウザ技術にはありません。

これがJavaScriptをユニークなものにしています。だからこそ、ブラウザインタフェースを作成するための最も普及したツールとなっています。


## JavaScriptを "覆う" 言語
=======
That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.

That said, JavaScript also allows to create servers, mobile applications, etc.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8

JavaScriptの構文は、すべての人のニーズにマッチしている訳ではありません。人によって求める機能は異なります。

Expand All @@ -105,18 +181,37 @@ JavaScriptの構文は、すべての人のニーズにマッチしている訳
そのため、最近では新しい言語が数多く登場しています。これらはブラウザで実行する前にJavaScriptに *トランスパイル* (変換)されます。


<<<<<<< HEAD
最新のツールは非常に高速にトランスパイルでき、透過的です。開発者が別の言語でコードを作成し、それを自動変換することができます。
=======
Modern tools make the transpilation very fast and transparent, actually allowing developers to code in another language and auto-converting it "under the hood".
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8

これは、そのような言語の例です:

<<<<<<< HEAD
- [CoffeeScript](http://coffeescript.org/) はJavaScriptの "シンタックスシュガー"です。より短い構文を導入し、より簡潔でクリアなコードを書くことができます。たいてい、Ruby 開発者は好きです。
- [TypeScript](http://www.typescriptlang.org/) は "厳密なデータ型指定" の追加に焦点をあてています。それは複雑なシステムの開発とサポートを簡素化するためです。これは Microsoftにより開発されています。
- [Dart](https://www.dartlang.org/) はブラウザ以外の環境(モバイルアプリのような)で動作する独自のエンジンを持ったスタンドアローンな言語です。最初はGoogleによって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.
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.

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

## サマリ

<<<<<<< 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.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8
44 changes: 44 additions & 0 deletions 1-js/01-getting-started/2-manuals-specifications/article.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

<<<<<<< HEAD
# マニュアルと仕様

この本は *チュートリアル* であり、あなたが徐々に言語を学ぶのを助けることを目的としています。そのため、基本が理解できたら別の情報源が必要になってきます。
Expand Down Expand Up @@ -40,3 +41,46 @@ JavaScript は開発中の言語であり、定期的に新機能が追加され
これらのリソースは、言語の詳細やサポートなどに関する貴重な情報が含まれているため、実際の開発に役立ちます。

特定の機能に関する詳細な情報が必要な場合は、それら(またはこのページ)を覚えておいてください。
=======
# Manuals and specifications

This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other sources.

## Specification

[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.

But being that formalized, it's difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it's not for everyday use.

A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.

To read about new bleeding-edge features, including those that are "almost standard" (so-called "stage 3"), see proposals at <https://github.com/tc39/proposals>.

Also, if you're in developing for the browser, then there are other specs covered in the [second part](info:browser-environment) of the tutorial.

## Manuals

- **MDN (Mozilla) JavaScript Reference** is a manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.

One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.

Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for `parseInt` function.


- **MSDN** – Microsoft manual with a lot of information, including JavaScript (often referred to as JScript). If one needs something specific to Internet Explorer, better go there: <http://msdn.microsoft.com/>.

Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".

## Compatibility tables

JavaScript is a developing language, new features get added regularly.

To see their support among browser-based and other engines, see:

- <http://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <http://caniuse.com/#feat=cryptography>.
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.

All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.

Please remember them (or this page) for the cases when you need in-depth information about a particular feature.
>>>>>>> d35baee32dcce127a69325c274799bb81db1afd8
Loading