Skip to content

Commit 4c4ef78

Browse files
committed
merging all conflicts
2 parents 58b8b96 + 540d753 commit 4c4ef78

File tree

319 files changed

+5775
-2560
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

+5775
-2560
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: iliakan

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ sftp-config.json
2121
Thumbs.db
2222

2323

24+
/svgs

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

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
Let's see what's so special about JavaScript, what we can achieve with it, and which other technologies play well with it.\
33
בואו נראה מה כל כך מיוחד בג'אווהסקריפט, מה אפשר לעשות עם השפה, ועם אילו טכנולוגיות נוספות מסתדרות היא מסתדרת נהדר.
44

5+
<<<<<<< HEAD
56
## מה זה ג'אווה סקריפט
7+
=======
8+
Let's see what's so special about JavaScript, what we can achieve with it, and what other technologies play well with it.
9+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
610
711
*JavaScript* was initially created to "make web pages alive".\
812
*ג'אווהסקריפט* נוצרה במטרה "להחיות" את האינטרנט
@@ -27,26 +31,26 @@ The browser has an embedded engine sometimes called a "JavaScript virtual machin
2731

2832
Different engines have different "codenames". For example:
2933

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

34-
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.
38+
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.
3539

3640
```smart header="How do engines work?"
3741
3842
Engines are complicated. But the basics are easy.
3943
4044
1. The engine (embedded if it's a browser) reads ("parses") the script.
41-
2. Then it converts ("compiles") the script to the machine language.
45+
2. Then it converts ("compiles") the script to machine code.
4246
3. And then the machine code runs, pretty fast.
4347
4448
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.
4549
```
4650

4751
## What can in-browser JavaScript do?
4852

49-
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.
53+
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.
5054

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

@@ -62,25 +66,25 @@ For instance, in-browser JavaScript is able to:
6266

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

65-
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.
69+
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.
6670

6771
Examples of such restrictions include:
6872

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

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

73-
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).
74-
- 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).
77+
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).
78+
- 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).
7579

76-
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.
80+
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.
7781

78-
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.
82+
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.
7983
- 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.
8084

8185
![](limitations.svg)
8286

83-
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.
87+
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.
8488

8589
## What makes JavaScript unique?
8690

@@ -89,36 +93,37 @@ There are at least *three* great things about JavaScript:
8993
```compare
9094
+ Full integration with HTML/CSS.
9195
+ Simple things are done simply.
92-
+ Support by all major browsers and enabled by default.
96+
+ Supported by all major browsers and enabled by default.
9397
```
9498
JavaScript is the only browser technology that combines these three things.
9599

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

98-
That said, JavaScript also allows to create servers, mobile applications, etc.
102+
That said, JavaScript can be used to create servers, mobile applications, etc.
99103

100104
## Languages "over" JavaScript
101105

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

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

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

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

110114
Examples of such languages:
111115

112-
- [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.
113-
- [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.
114-
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
116+
- [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.
117+
- [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.
118+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
115119
- [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.
116-
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that allow to write application in pure Python without JavaScript.
120+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
121+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
117122

118-
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.
123+
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.
119124

120125
## Summary
121126

122-
- JavaScript was initially created as a browser-only language, but is now used in many other environments as well.
123-
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration with HTML/CSS.
127+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
128+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
124129
- 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.
Lines changed: 8 additions & 13 deletions
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.

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

Lines changed: 9 additions & 6 deletions
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).

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

Lines changed: 2 additions & 2 deletions
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

-41.1 KB
Binary file not shown.
22.2 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
83 KB
Loading
Loading

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ So first, let's see how we attach a script to a webpage. For server-side environ
99

1010
## The "script" tag
1111

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

1414
For instance:
1515

@@ -73,7 +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 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.
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"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder.
7777

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

0 commit comments

Comments
 (0)