Skip to content

Commit 519a0fb

Browse files
authored
Merge pull request #15 from javascript-tutorial/sync-a0bfa924
Sync with upstream @ a0bfa92
2 parents 72b76a1 + d92618b commit 519a0fb

File tree

324 files changed

+8211
-6319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+8211
-6319
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto eol=lf
2+
*.svg binary

1-js/01-getting-started/1-intro/article.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212

1313
Σε αυτό το σημείο, να συμπληρώσω οτι η JavaScript έχει μεγάλη διάφορα με την [Java](https://en.wikipedia.org/wiki/Java_(programming_language)).
1414

15+
<<<<<<< HEAD
1516
'''smart header="Γιατί <u>Java</u>Script?"
1617
Όταν είχε φτιαχτεί η JavaScript, είχε ένα διαφορετικό όνομά, λεγότανε "LiveScript". Αλά η Java ήταν πολύ γνωστή εκείνη την εποχή, οπότε αποφασίστηκε οτι θα βοηθούσε αν έκαναν την γλωσσά προγραμματισμού τον "μικρο αδελφό" της Java.
18+
=======
19+
```smart header="Why is it called <u>Java</u>Script?"
20+
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.
21+
>>>>>>> a0bfa924a17cad8e7fee213904b27dbf57c2dbac
1722
1823
Αλλά καθώς εξελίχθηκε, η JavaScript έγινε μια πλήρως ανεξάρτητη γλώσσα με τη δική της προδιαγραφή που ονομάζεται [ECMAScript] (http://en.wikipedia.org/wiki/ECMAScript), και τώρα δεν έχει καμία σχέση με την Java
1924
@@ -90,7 +95,11 @@ JavaScript is the only browser technology that combines these three things.
9095
9196
That's what makes JavaScript unique. That's why it's the most widespread tool for creating browser interfaces.
9297
98+
<<<<<<< HEAD
9399
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.
100+
=======
101+
That said, JavaScript also allows to create servers, mobile applications, etc.
102+
>>>>>>> a0bfa924a17cad8e7fee213904b27dbf57c2dbac
94103
95104
## Languages "over" JavaScript
96105

1-js/01-getting-started/2-manuals-specifications/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ This book is a *tutorial*. It aims to help you gradually learn the language. But
55

66
## Specification
77

8-
**The ECMA-262 specification** contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
8+
[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.
99

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

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

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

@@ -24,7 +24,7 @@ Also, if you're in developing for the browser, then there are other specs covere
2424
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.
2525

2626

27-
- **MSDN** – Microsoft manual with a lot of information, including JavaScript (often referrerd to as JScript). If one needs something specific to Internet Explorer, better go there: <http://msdn.microsoft.com/>.
27+
- **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/>.
2828

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

1-js/01-getting-started/3-code-editors/article.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ In practice, lightweight editors may have a lot of plugins including directory-l
3232
The following options deserve your attention:
3333

3434
- [Atom](https://atom.io/) (cross-platform, free).
35+
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
3536
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
3637
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
3738
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.

1-js/01-getting-started/4-devtools/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom
5050

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

53-
## Multi-line input
54-
53+
```smart header="Multi-line input"
5554
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
5655
57-
To insert multiple lines, press `key:Shift+Enter`.
56+
To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
57+
```
5858

5959
## Summary
6060

2.08 KB
Loading
-18.6 KB
Loading

1-js/02-first-steps/01-hello-world/article.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hello, world!
22

3-
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.
3+
This part of the tutorial is about core JavaScript, the language itself.
44

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

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

4848
The `type` attribute: <code>&lt;script <u>type</u>=...&gt;</code>
49-
: 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.
49+
: 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.
5050

5151
The `language` attribute: <code>&lt;script <u>language</u>=...&gt;</code>
5252
: 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.
@@ -60,7 +60,7 @@ Comments before and after scripts.
6060
//--></script>
6161
```
6262

63-
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.
63+
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.
6464

6565

6666
## External scripts
@@ -73,9 +73,7 @@ Script files are attached to HTML with the `src` attribute:
7373
<script src="/path/to/script.js"></script>
7474
```
7575

76-
Here, `/path/to/script.js` is an absolute path to the script file (from the site root).
77-
78-
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.
76+
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"` would mean a file `"script.js"` in the current folder.
7977

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

1-js/02-first-steps/03-strict-mode/article.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ For a long time, JavaScript evolved without compatibility issues. New features w
44

55
That had the benefit of never breaking existing code. But the downside was that any mistake or an imperfect decision made by JavaScript's creators got stuck in the language forever.
66

7-
This was the case until 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most modifications are off by default. You need to explicitly enable them with a special directive: `"use strict"`.
7+
This was the case until 2009 when ECMAScript 5 (ES5) appeared. It added new features to the language and modified some of the existing ones. To keep the old code working, most such modifications are off by default. You need to explicitly enable them with a special directive: `"use strict"`.
88

99
## "use strict"
1010

@@ -19,9 +19,7 @@ For example:
1919
...
2020
```
2121

22-
We will learn functions (a way to group commands) soon.
23-
24-
Looking ahead, let's just note that `"use strict"` can be put at the start of most kinds of functions instead of the whole script. Doing that enables strict mode in that function only. But usually, people use it for the whole script.
22+
We will learn functions (a way to group commands) soon. Looking ahead, let's note that `"use strict"` can be put at the beginning of the function body instead of the whole script. Doing that enables strict mode in that function only. But usually, people use it for the whole script.
2523

2624

2725
````warn header="Ensure that \"use strict\" is at the top"

1-js/02-first-steps/04-variables/2-declare-variables/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
First, the variable for the name of our planet.
1+
## The variable for our planet
22

33
That's simple:
44

@@ -8,7 +8,7 @@ let ourPlanetName = "Earth";
88

99
Note, we could use a shorter name `planet`, but it might be not obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.
1010

11-
Second, the name of the current visitor:
11+
## The name of the current visitor
1212

1313
```js
1414
let currentUserName = "John";

0 commit comments

Comments
 (0)