Skip to content

Sync with upstream @ 4541b7af #103

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 2,963 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2963 commits
Select commit Hold shift + click to select a range
0cbf55d
Merge pull request #2595 from josecervino/patch-1
iliakan May 13, 2021
094b829
Merge pull request #2598 from joaquinelio/patch-7
iliakan May 13, 2021
339535d
Merge pull request #2599 from H2rmone/master
iliakan May 13, 2021
3bf8830
Update article.md
iliakan May 13, 2021
237920b
Update article.md
iliakan May 13, 2021
33f1b11
minor fixes
iliakan May 13, 2021
6ad8930
minor fixes
iliakan May 13, 2021
fafab82
typo
joaquinelio May 15, 2021
4177be3
Merge pull request #2602 from joaquinelio/patch-4
iliakan May 16, 2021
80956ed
closes #2600
iliakan May 16, 2021
11e0890
Fix typo.
odsantos May 16, 2021
89183a0
minor fixes
iliakan May 16, 2021
bad5236
minor fixes
iliakan May 16, 2021
70049c3
minor fixes
iliakan May 16, 2021
859fa9b
minor fixes
iliakan May 16, 2021
fb09afc
minor fixes
iliakan May 16, 2021
f598b72
minor fixes
iliakan May 16, 2021
f841402
minor fixes
iliakan May 16, 2021
18a0394
minor fixes
iliakan May 16, 2021
ac96ede
Remove mentions of :host-context
web-padawan May 17, 2021
ae8248b
minor fixes
iliakan May 17, 2021
d2ae45d
Update article.md
Dorin-David May 20, 2021
ffa79a8
minor fixes
iliakan May 24, 2021
a917f9c
minor fixes
iliakan May 24, 2021
94837c2
minor fixes
iliakan May 24, 2021
3e74537
minor fixes
iliakan May 24, 2021
006343a
minor fixes
iliakan May 24, 2021
df45aed
minor fixes
iliakan May 24, 2021
8871521
minor fixes
iliakan May 24, 2021
1770074
minor fixes
iliakan May 24, 2021
3dbe9d1
minor fixes
iliakan May 24, 2021
2fc7cb2
minor fixes
iliakan May 24, 2021
649a159
minor fixes
iliakan May 24, 2021
62db4bb
minor fixes
iliakan May 24, 2021
3288801
minor fixes
iliakan May 24, 2021
6db4961
minor fixes
iliakan May 24, 2021
4343545
minor fixes
iliakan May 24, 2021
053cc05
minor fixes
iliakan May 24, 2021
842f0e2
minor fixes
iliakan May 24, 2021
70bb265
minor fixes
iliakan May 24, 2021
fc3c071
minor fixes
iliakan May 24, 2021
7a30a00
minor fixes
iliakan May 24, 2021
6cfa8b4
minor fixes
iliakan May 24, 2021
649c758
minor fixes
iliakan May 24, 2021
f2636ee
minor fixes
iliakan May 24, 2021
9ba208f
minor fixes
iliakan May 24, 2021
cf33b67
minor fixes
iliakan May 24, 2021
f8313dc
Update article.md
AhmedElaguab May 28, 2021
88ba2c2
Merge pull request #2 from AhmedElaguab/AhmedElaguab-fix-typo
AhmedElaguab May 28, 2021
4c35f59
"not required" vs "incorrect"
joaquinelio May 29, 2021
c2d5f8e
easier to read
joaquinelio Jun 4, 2021
52cb884
Update article.md
leviding Jun 7, 2021
6a742c4
Update article.md
leviding Jun 8, 2021
581802d
minor fixes
iliakan Jun 9, 2021
68172cc
typo
joaquinelio Jun 10, 2021
0e49461
typpo
joaquinelio Jun 10, 2021
964ba15
function parameters vs arguments
iliakan Jun 13, 2021
1ccd673
Merge pull request #2624 from joaquinelio/patch-11
iliakan Jun 13, 2021
54ff266
Merge pull request #2623 from joaquinelio/patch-9
iliakan Jun 13, 2021
2b1600e
Merge pull request #2622 from leviding/patch-37
iliakan Jun 13, 2021
581117f
Merge pull request #2621 from leviding/patch-36
iliakan Jun 13, 2021
dcf4b5b
closes #2619
iliakan Jun 13, 2021
2290bd6
Merge pull request #2616 from joaquinelio/patch-8
iliakan Jun 13, 2021
bcb47b7
Merge pull request #2612 from joaquinelio/patch-4
iliakan Jun 13, 2021
5f927bd
Merge pull request #2611 from AhmedElaguab/master
iliakan Jun 13, 2021
4d46f12
Merge pull request #2606 from Dorin-David/patch-1
iliakan Jun 13, 2021
e4ac603
Merge pull request #2605 from web-padawan/patch-1
iliakan Jun 13, 2021
ee5853d
Merge pull request #2604 from odsantos/regex-methods
iliakan Jun 13, 2021
bcf2e48
minor fixes
iliakan Jun 13, 2021
225a36f
Merge branch 'master' of github.com:javascript-tutorial/en.javascript…
iliakan Jun 13, 2021
617dfc7
minor fixes
iliakan Jun 13, 2021
3d88d33
Update article.md
ZYinMD Jun 13, 2021
e2d1823
minor fixes
iliakan Jun 13, 2021
614e29e
minor fixes
iliakan Jun 13, 2021
a171b0a
fix typo in 1-js/05-data-types/03-string
ZYinMD Jun 13, 2021
e527c61
Merge pull request #2630 from ZYinMD/patch-10
iliakan Jun 13, 2021
b258e8f
minor fixes
iliakan Jun 14, 2021
fb4fc33
minor fixes
iliakan Jun 15, 2021
2dce19e
"inserts into" instead of "appends to"
joaquinelio Jun 16, 2021
497ca99
Update article.md
joaquinelio Jun 16, 2021
9680c67
Merge pull request #2633 from joaquinelio/patch-4
iliakan Jun 16, 2021
cd466c5
Unnecessary escape characters in cookie.js
NNboru Jun 17, 2021
8c910b4
Update article.md
joaquinelio Jun 18, 2021
8cf2d51
Update article.md
joaquinelio Jun 18, 2021
0c41930
Update article.md
joaquinelio Jun 18, 2021
263f57e
Update article.md
joaquinelio Jun 18, 2021
492f506
Merge pull request #2555 from joaquinelio/patch-6
iliakan Jun 18, 2021
a6dfbb7
minor fixes
iliakan Jun 18, 2021
29f0121
Merge pull request #2636 from NNboru/patch-1
iliakan Jun 18, 2021
de36d0d
update one code comment in 1-js/09-classes/04-private-protected-prope…
ZYinMD Jun 18, 2021
c45e78f
Maybe. "accessors" link
joaquinelio Jun 18, 2021
d43bdd2
slightly improve clarity on Promise.all()
ZYinMD Jun 19, 2021
e49bc3b
Merge pull request #2627 from ZYinMD/patch-5
iliakan Jun 19, 2021
e877796
closes #2641
iliakan Jun 19, 2021
ff53f06
minor fixes
iliakan Jun 19, 2021
cf82cc3
minor fixes
iliakan Jun 19, 2021
85282ef
minor fixes
iliakan Jun 19, 2021
a40ca9a
minor fixes
iliakan Jun 19, 2021
54347b7
minor fixes
iliakan Jun 19, 2021
df6e5a4
minor fixes
iliakan Jun 19, 2021
e769408
minor fixes
iliakan Jun 19, 2021
de81cb4
minor fixes
iliakan Jun 19, 2021
7dacfd4
minor fixes
iliakan Jun 19, 2021
3661393
minor fixes
iliakan Jun 19, 2021
1b16f9d
Merge pull request #2640 from ZYinMD/patch-17
iliakan Jun 19, 2021
6f14c39
Merge pull request #2639 from joaquinelio/patch-4
iliakan Jun 19, 2021
52eaa63
typo
joaquinelio Jun 20, 2021
9847492
Typo in Ch 15 Functions
Yoona8 Jun 20, 2021
140c75d
Merge pull request #2644 from Yoona8/master
iliakan Jun 20, 2021
ffe91a6
Merge pull request #2643 from joaquinelio/patch-6
iliakan Jun 20, 2021
8558fa8
Merge pull request #2638 from ZYinMD/patch-16
iliakan Jun 20, 2021
b19a6f0
minor fixes
iliakan Jun 21, 2021
66bad3f
fix typo in 5-network/02-formdata
ZYinMD Jun 22, 2021
d7c2f08
Add one letter in 5-network/03-fetch-progress
ZYinMD Jun 22, 2021
c4efc35
minor grammar change in webcomponents-intro
ZYinMD Jun 23, 2021
b855f6c
add a section about css animation performance
ZYinMD Jun 24, 2021
9b99012
Merge pull request #2654 from ZYinMD/patch-24
iliakan Jun 24, 2021
c41361f
animation
iliakan Jun 24, 2021
8b3730b
minor fixes
iliakan Jun 24, 2021
2961588
minor fixes
iliakan Jun 24, 2021
753182b
minor fixes
iliakan Jun 24, 2021
7d838b3
minor fixes
iliakan Jun 24, 2021
32f01fb
minor fixes
iliakan Jun 24, 2021
6c15ba4
minor fixes
iliakan Jun 24, 2021
771aab4
minor fixes
iliakan Jun 24, 2021
2eb4251
minor fixes
iliakan Jun 24, 2021
2811211
minor fixes
iliakan Jun 24, 2021
27af482
minor fixes
iliakan Jun 24, 2021
934d32b
minor fixes
iliakan Jun 24, 2021
4420427
minor fixes
iliakan Jun 24, 2021
e609815
minor fixes
iliakan Jun 24, 2021
e06bc63
minor fixes
iliakan Jun 24, 2021
e79ce9d
minor fixes
iliakan Jun 25, 2021
c001068
minor fixes
iliakan Jun 25, 2021
dab34f7
minor fixes
iliakan Jun 26, 2021
e9d2a31
minor fixes
iliakan Jun 26, 2021
a0af69e
minor fixes
iliakan Jun 26, 2021
4ed51aa
minor fixes
iliakan Jun 26, 2021
54688eb
minor fixes
iliakan Jun 26, 2021
6dda47f
minor fixes
iliakan Jun 26, 2021
e8d7f37
minor fixes
iliakan Jun 26, 2021
9bba570
minor fixes
iliakan Jun 26, 2021
7725acc
minor fixes
iliakan Jun 26, 2021
bed62e1
Add generator.return
Manik2375 Jun 27, 2021
624b48b
Update article.md
Manik2375 Jun 27, 2021
8db6519
minor fixes
iliakan Jun 27, 2021
8752573
minor fixes
iliakan Jun 27, 2021
76656bd
minor fixes
iliakan Jun 27, 2021
16b9bda
minor fixes
iliakan Jun 28, 2021
2275894
Merge pull request #2657 from Manik2375/generator.return
iliakan Jul 1, 2021
e195256
Response header name is changed to the right one
websavva Jul 3, 2021
16de27d
Fix a small grammar mistake
iliyu Jul 4, 2021
89e22f8
confusing line
joaquinelio Jul 13, 2021
02c75d2
Update task.md
joaquinelio Jul 13, 2021
19ec58b
Update article.md
Gammadon Jul 16, 2021
ce38273
add a missing colon
mahdyar Jul 17, 2021
c3214e7
Update article.md
iliakan Jul 21, 2021
1bf6973
Merge pull request #2673 from mahdyar/patch-1
iliakan Jul 22, 2021
667eb56
Merge pull request #2672 from Gammadon/patch-1
iliakan Jul 22, 2021
a5f339e
Merge pull request #2670 from joaquinelio/patch-6
iliakan Jul 22, 2021
237d883
Merge pull request #2662 from riri-yu/patch-1
iliakan Jul 22, 2021
cb97b72
Merge pull request #2661 from WebSavva/patch-1
iliakan Jul 22, 2021
df215cd
Merge pull request #2653 from ZYinMD/patch-21
iliakan Jul 22, 2021
614c85a
minor fixes
iliakan Jul 22, 2021
0082fbe
minor fixes
iliakan Jul 22, 2021
173ce27
Merge pull request #2649 from ZYinMD/patch-20
iliakan Jul 22, 2021
823eea4
Merge pull request #2648 from ZYinMD/patch-19
iliakan Jul 22, 2021
2957e71
minor fixes
iliakan Jul 23, 2021
1b1a2c4
minor fixes
iliakan Jul 23, 2021
9c5388c
pointer events improvements
iliakan Jul 24, 2021
57ff060
minor fixes
iliakan Jul 24, 2021
2a6fd54
old and new
joaquinelio Jul 26, 2021
ef8d576
Merge pull request #2680 from joaquinelio/patch-4
iliakan Jul 26, 2021
05a97a0
Update article.md
RainbowDashy Aug 1, 2021
12d7968
Make use of `loadJson` inside `loadGithubUser`
Aug 6, 2021
1808fe3
slider not working on movile
joaquinelio Aug 8, 2021
4a7fe13
Update index.html
joaquinelio Aug 8, 2021
58f9c8d
minor fixes
iliakan Aug 8, 2021
bc08fd1
Merge pull request #2689 from joaquinelio/patch-8
iliakan Aug 8, 2021
6b4cfc2
Fix grammar
siimpragi Aug 9, 2021
d404087
Fix typo.
odsantos Aug 9, 2021
95ad576
Update article.md
msmilkshake Aug 11, 2021
f17c07a
Fix compound interest formula
shvchk Aug 14, 2021
a19e517
Update URLs
odsantos Aug 14, 2021
d3ae613
Merge pull request #2683 from RainbowDashy/patch-1
iliakan Aug 14, 2021
ed3b2c0
Merge pull request #2696 from odsantos/property-descriptors
iliakan Aug 14, 2021
71688e7
Merge pull request #2695 from shvchk/master
iliakan Aug 14, 2021
7edd7c3
Merge pull request #2694 from msmilkshake/patch-1
iliakan Aug 14, 2021
71f8a9e
Merge pull request #2693 from odsantos/css-animations-typo
iliakan Aug 14, 2021
3b7a35e
Merge pull request #2692 from siimpragi/patch-1
iliakan Aug 14, 2021
a6c0fad
Merge pull request #2686 from mindv0rtex/patch-1
iliakan Aug 14, 2021
4d01fc2
minor fixes
iliakan Aug 15, 2021
1b31575
promise chain flow
joaquinelio Aug 15, 2021
8287e24
edge
joaquinelio Aug 16, 2021
623737b
Update article.md
deisner Aug 21, 2021
22b7b51
Update article.md
Aug 26, 2021
e69a943
Update urls
imba-tjd Aug 27, 2021
08a5308
Update article.md
baooab Sep 11, 2021
1059096
Update URL.
odsantos Sep 14, 2021
df39e1a
Update article.md
vladdoroniuk Sep 14, 2021
76ef126
Fix typo
rizkyzhang Sep 22, 2021
7abc297
picture minor fixes
iliakan Sep 25, 2021
b09e38c
minor fixes
iliakan Sep 25, 2021
7651ae0
minor typo
fionatagious Oct 1, 2021
2f98054
chore: fix a typo
mahdyar Oct 4, 2021
f4801c3
closes #2738
iliakan Oct 10, 2021
171d2e7
Merge pull request #2731 from mahdyar/patch-1
iliakan Oct 10, 2021
3d47402
Merge pull request #2729 from fionatagious/patch-1
iliakan Oct 10, 2021
5c1ee32
Merge pull request #2725 from rizkyzhang/patch-6
iliakan Oct 10, 2021
1c63023
Merge pull request #2721 from xirly/master
iliakan Oct 10, 2021
9e4a1e9
Merge pull request #2720 from odsantos/object-references
iliakan Oct 10, 2021
8794b71
Merge pull request #2717 from baooab/patch-9
iliakan Oct 10, 2021
2e494c7
Merge pull request #2697 from joaquinelio/patch-4
iliakan Oct 10, 2021
f1210b4
minor
iliakan Oct 10, 2021
cbc4350
Merge pull request #2698 from joaquinelio/patch-5
iliakan Oct 10, 2021
0d67376
Merge pull request #2701 from deisner/patch-1
iliakan Oct 10, 2021
ab2c57c
Merge pull request #2704 from wilburn98/master
iliakan Oct 10, 2021
193319c
Merge pull request #2705 from imba-tjd/patch-1
iliakan Oct 10, 2021
e3b10e6
sort-by-field fix
joneskj55 Oct 10, 2021
91a89ea
Update article.md
LexaWin Oct 11, 2021
eda333d
minor fixes
iliakan Oct 12, 2021
4397c7f
not a right comparison
Jiapan-Yu Oct 21, 2021
c20baa7
Add missing "!"
mahdiHash Oct 21, 2021
db074cd
Remove redundant word in Possible Mistakes section
vigu86 Oct 22, 2021
e0624c3
Update article.md
dneey Oct 22, 2021
1310d54
fix typo
KennethKinLum Oct 23, 2021
4c2658d
Fixed a grammatical error
zaibugemi Oct 24, 2021
6250c91
Merge pull request #1 from zaibugemi/zaibugemi-patch-1
zaibugemi Oct 24, 2021
3699f73
async-await on top
iliakan Oct 25, 2021
277fbd2
Merge pull request #2762 from zaibugemi/master
iliakan Oct 25, 2021
2a5c881
minor fixes
iliakan Oct 25, 2021
e95cab9
Merge pull request #2741 from joneskj55/patch-1
iliakan Oct 25, 2021
51be747
Merge pull request #2744 from LexaWin/patch-1
iliakan Oct 25, 2021
aed8070
Merge pull request #2750 from Jiapan-Yu/master
iliakan Oct 25, 2021
20da240
Merge pull request #2751 from mahdiHashemi14/master
iliakan Oct 25, 2021
3c62ecc
Merge pull request #2753 from vigu86/patch-1
iliakan Oct 25, 2021
676319d
Merge pull request #2755 from dneey/patch-2
iliakan Oct 25, 2021
3efe4cf
Merge pull request #2759 from KennethKinLum/patch-14
iliakan Oct 25, 2021
9dc5f3e
minor fixes
iliakan Oct 25, 2021
91e9b9c
minor fixes
iliakan Oct 25, 2021
6be354d
minor fixes
iliakan Oct 25, 2021
2ac7526
minor fixes
iliakan Oct 25, 2021
8308537
closes #2757
iliakan Oct 25, 2021
6989312
closes #2752
iliakan Oct 25, 2021
cc18823
minor fixes
iliakan Nov 1, 2021
be69f34
minor fixes
iliakan Nov 1, 2021
9fcffe1
minor fixes
iliakan Nov 1, 2021
15f7acf
minor fixes
iliakan Nov 1, 2021
4541b7a
minor fixes
iliakan Nov 3, 2021
e03e457
merging all conflicts
iliakan Nov 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text=auto eol=lf
*.svg binary
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ sftp-config.json
Thumbs.db


/svgs
34 changes: 18 additions & 16 deletions 1-js/01-getting-started/1-intro/article.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# An Introduction to JavaScript

Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.
Let's see what's so special about JavaScript, what we can achieve with it, and what other technologies play well with it.

## What is JavaScript?

*JavaScript* was initially created to *"make web pages alive"*.
*JavaScript* was initially created to "make web pages alive".

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

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

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

```smart header="Why <u>Java</u>Script?"
```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.
Expand All @@ -24,11 +24,11 @@ The browser has an embedded engine sometimes called a "JavaScript virtual machin

Different engines have different "codenames". For example:

- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
- [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.
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "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, Opera and Edge.

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

Expand All @@ -38,7 +38,7 @@ 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 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.
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.
```

## What can in-browser JavaScript do?
Expand All @@ -59,11 +59,11 @@ For instance, in-browser JavaScript is able to:

## What CAN'T in-browser JavaScript do?

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.
JavaScript's abilities in the browser are limited for the sake of a user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.

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

Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like "dropping" a file into a browser window or selecting it via an `<input>` tag.

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

That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.

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

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

## Languages "over" JavaScript

Expand All @@ -109,12 +108,15 @@ Examples of such languages:

- [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.
- [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.
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.

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

## Summary

- 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.
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated 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.
37 changes: 37 additions & 0 deletions 1-js/01-getting-started/2-manuals-specifications/article.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# 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 developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial.

## Manuals

- **MDN (Mozilla) JavaScript Reference** is the main 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.

## 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.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ An IDE loads the project (which can be many files), allows navigation between fi

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

- [WebStorm](http://www.jetbrains.com/webstorm/) for frontend development. The same company offers other editors for other languages (paid).
- [Netbeans](http://netbeans.org/) (free).
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).

All of these IDEs are cross-platform.
For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code". "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. It's also good at JavaScript. There's also a free version [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.
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.

## Lightweight editors

Expand All @@ -33,21 +31,11 @@ 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) also has many IDE-like features.
- [Atom](https://atom.io/) (cross-platform, free).
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.

## My favorites

The personal preference of the author is to have both an IDE for projects and a lightweight editor for quick and easy file editing.

I'm using:

- 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

The editors in the lists above are those that either I or my friends whom I consider good developers have been using for a long time and are happy with.
Expand Down
Binary file removed 1-js/01-getting-started/3-devtools/safari.png
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ The exact look of developer tools depends on your version of Chrome. It changes
- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command.
- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred.

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

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

```smart header="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`. This way one can enter long fragments of JavaScript code.
```

## Firefox, Edge, and others

Expand All @@ -50,12 +55,6 @@ Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom

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.
Expand Down
Binary file added 1-js/01-getting-started/4-devtools/safari.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>

<body>

<script>
alert( "I'm JavaScript!" );
</script>

</body>

</html>
2 changes: 2 additions & 0 deletions 1-js/02-first-steps/01-hello-world/1-hello-alert/solution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

[html src="index.html"]
14 changes: 6 additions & 8 deletions 1-js/02-first-steps/01-hello-world/article.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hello, world!

This part of the tutorial is about core JavaScript, the language itself. Later on, you'll learn about Node.js and other platforms that use it.
This part of the tutorial is about core JavaScript, the language itself.

But we need a working environment to run our scripts and, since this book is online, the browser is a good choice. We'll keep the amount of browser-specific commands (like `alert`) to a minimum so that you don't spend time on them if you plan to concentrate on another environment (like Node.js). We'll focus on JavaScript in the browser in the [next part](/ui) of the tutorial.

Expand All @@ -9,7 +9,7 @@ So first, let's see how we attach a script to a webpage. For server-side environ

## The "script" tag

JavaScript programs can be inserted into any part of an HTML document with the help of the `<script>` tag.
JavaScript programs can be inserted almost anywhere into an HTML document using the `<script>` tag.

For instance:

Expand Down Expand Up @@ -46,7 +46,7 @@ The `<script>` tag contains JavaScript code which is automatically executed when
The `<script>` tag has a few attributes that are rarely used nowadays but can still be found in old code:

The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard, HTML5, totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic; we'll talk about modules in another part of the tutorial.
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic, we'll talk about modules in another part of the tutorial.

The `language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
: This attribute was meant to show the language of the script. This attribute no longer makes sense because JavaScript is the default language. There is no need to use it.
Expand All @@ -60,7 +60,7 @@ Comments before and after scripts.
//--></script>
```

This trick isn't used in modern JavaScript. These comments hid JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.


## External scripts
Expand All @@ -73,14 +73,12 @@ Script files are attached to HTML with the `src` attribute:
<script src="/path/to/script.js"></script>
```

Here, `/path/to/script.js` is an absolute path to the script file (from the site root).

You can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder.
Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder.

We can give a full URL as well. For instance:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.2.0/lodash.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
```

To attach several scripts, use multiple tags:
Expand Down
Loading