Skip to content

Commit 04d8816

Browse files
committed
merging all conflicts
2 parents 8e4b7c1 + 540d753 commit 04d8816

File tree

319 files changed

+5885
-2505
lines changed

Some content is hidden

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

319 files changed

+5885
-2505
lines changed

Diff for: .github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: iliakan

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ sftp-config.json
2121
Thumbs.db
2222

2323

24+
/svgs

Diff for: 1-js/01-getting-started/1-intro/article.md

+23-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# An Introduction to JavaScript
22

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

55
## What is JavaScript?
66

@@ -24,26 +24,26 @@ The browser has an embedded engine sometimes called a "JavaScript virtual machin
2424

2525
Different engines have different "codenames". For example:
2626

27-
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome and Opera.
27+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
2828
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
29-
- ...There are other codenames like "Chakra" for IE, "ChakraCore" for Microsoft Edge, "Nitro" and "SquirrelFish" for Safari, etc.
29+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
3030

31-
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.
31+
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.
3232

3333
```smart header="How do engines work?"
3434
3535
Engines are complicated. But the basics are easy.
3636
3737
1. The engine (embedded if it's a browser) reads ("parses") the script.
38-
2. Then it converts ("compiles") the script to the machine language.
38+
2. Then it converts ("compiles") the script to machine code.
3939
3. And then the machine code runs, pretty fast.
4040
4141
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.
4242
```
4343

4444
## What can in-browser JavaScript do?
4545

46-
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.
46+
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or the CPU, because it was initially created for browsers which do not require it.
4747

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

@@ -59,25 +59,25 @@ For instance, in-browser JavaScript is able to:
5959

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

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

6464
Examples of such restrictions include:
6565

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

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

70-
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).
71-
- 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).
70+
There are ways to interact with the 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).
71+
- 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 page if they come from different sites (from a different domain, protocol or port).
7272

73-
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.
73+
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and must contain special JavaScript code that handles it. We'll cover that in the tutorial.
7474

75-
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.
75+
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`, for example, and steal information from there.
7676
- 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.
7777

7878
![](limitations.svg)
7979

80-
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.
80+
Such limitations do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugins/extensions which may ask for extended permissions.
8181

8282
## What makes JavaScript unique?
8383

@@ -86,36 +86,37 @@ There are at least *three* great things about JavaScript:
8686
```compare
8787
+ Full integration with HTML/CSS.
8888
+ Simple things are done simply.
89-
+ Support by all major browsers and enabled by default.
89+
+ Supported by all major browsers and enabled by default.
9090
```
9191
JavaScript is the only browser technology that combines these three things.
9292

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

95-
That said, JavaScript also allows to create servers, mobile applications, etc.
95+
That said, JavaScript can be used to create servers, mobile applications, etc.
9696

9797
## Languages "over" JavaScript
9898

9999
The syntax of JavaScript does not suit everyone's needs. Different people want different features.
100100

101101
That's to be expected, because projects and requirements are different for everyone.
102102

103-
So recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
103+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
104104

105105
Modern tools make the transpilation very fast and transparent, actually allowing developers to code in another language and auto-converting it "under the hood".
106106

107107
Examples of such languages:
108108

109-
- [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.
110-
- [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.
111-
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
109+
- [CoffeeScript](https://coffeescript.org/) is "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
110+
- [TypeScript](https://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
111+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
112112
- [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.
113-
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that allow to write application in pure Python without JavaScript.
113+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
114+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
114115

115-
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.
116+
There are more. Of course, even if we use one of these transpiled languages, we should also know JavaScript to really understand what we're doing.
116117

117118
## Summary
118119

119-
- JavaScript was initially created as a browser-only language, but is now used in many other environments as well.
120-
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration with HTML/CSS.
120+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
121+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
121122
- 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.
+8-13
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
11

22
# Manuals and specifications
33

4-
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.
4+
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 resources.
55

66
## Specification
77

88
[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-
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
12+
A new specification version is released every year. 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

16-
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.
16+
Also, if you're developing for the browser, then there are other specifications covered in the [second part](info:browser-environment) of the tutorial.
1717

1818
## Manuals
1919

20-
- **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.
20+
- **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.
2121

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

24-
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.
25-
26-
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/>.
28-
29-
Also, we can use an internet search with phrases such as "RegExp MSDN" or "RegExp MSDN jscript".
24+
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 the `parseInt` function.
3025

3126
## Compatibility tables
3227

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

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

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

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

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

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

+9-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ An IDE loads the project (which can be many files), allows navigation between fi
1313
If you haven't selected an IDE yet, consider the following options:
1414

1515
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
16-
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
16+
- [WebStorm](https://www.jetbrains.com/webstorm/) (cross-platform, paid).
1717

1818
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/).
1919

@@ -29,13 +29,11 @@ The main difference between a "lightweight editor" and an "IDE" is that an IDE w
2929

3030
In practice, lightweight editors may have a lot of plugins including directory-level syntax analyzers and autocompleters, so there's no strict border between a lightweight editor and an IDE.
3131

32-
The following options deserve your attention:
32+
There are many options, for instance:
3333

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

4038
## Let's not argue
4139

@@ -44,3 +42,8 @@ The editors in the lists above are those that either I or my friends whom I cons
4442
There are other great editors in our big world. Please choose the one you like the most.
4543

4644
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
45+
46+
The author's personal opinion:
47+
48+
- I'd use [Visual Studio Code](https://code.visualstudio.com/) if I develop mostly frontend.
49+
- Otherwise, if it's mostly another language/platform and partially frontend, then consider other editors, such as XCode (Mac), Visual Studio (Windows) or Jetbrains family (Webstorm, PHPStorm, RubyMine etc, depending on the language).

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The developer tools will open on the Console tab by default.
2222

2323
It looks somewhat like this:
2424

25-
![chrome](chrome.png)
25+
![chrome](chrome.webp)
2626

2727
The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar.
2828

@@ -49,7 +49,7 @@ The look & feel of them is quite similar. Once you know how to use one of these
4949

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

52-
Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom:
52+
Open Settings and go to the "Advanced" pane. There's a checkbox at the bottom:
5353

5454
![safari](safari.png)
5555

Diff for: 1-js/01-getting-started/4-devtools/chrome.png

-41.1 KB
Binary file not shown.

Diff for: 1-js/01-getting-started/4-devtools/chrome.webp

22.2 KB
Binary file not shown.
48.3 KB
Binary file not shown.
-67.8 KB
Binary file not shown.

Diff for: 1-js/01-getting-started/4-devtools/safari.png

83 KB
Loading
55 KB
Loading

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

+8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Dus laten we eerst eens kijken hoe we een script aan een webpagina koppelen. Voo
99

1010
## De "script" tag
1111

12+
<<<<<<< HEAD
1213
JavaScript-programma's kunnen in elk deel van een HTML-document worden ingevoegd met behulp van de `<script>`-tag.
14+
=======
15+
JavaScript programs can be inserted almost anywhere into an HTML document using the `<script>` tag.
16+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
1317
1418
Bijvoorbeeld:
1519

@@ -73,7 +77,11 @@ Scriptbestanden worden aan HTML gekoppeld met het `src` attribuut:
7377
<script src="/pad/naar/script.js"></script>
7478
```
7579

80+
<<<<<<< HEAD
7681
Hier is `/pad/naar/script.js` een absoluut pad naar het script vanuit de site-root. Men kan ook een relatief pad van de huidige pagina opgeven. Bijvoorbeeld, `src="script.js "betekent een bestand `"script.js"` in de huidige map.
82+
=======
83+
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.
84+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
7785
7886
We kunnen ook een volledige URL geven. Bijvoorbeeld:
7987

0 commit comments

Comments
 (0)