Skip to content

Commit 48c6953

Browse files
committed
merging all conflicts
2 parents b755a7a + d78b01e commit 48c6953

File tree

256 files changed

+4531
-1656
lines changed

Some content is hidden

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

256 files changed

+4531
-1656
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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,47 @@ Spletni brskalniki uporabljajo različna imena za JavaScript engine:
4242
- [WebKit](<https://en.wikipedia.org/wiki/Safari_(web_browser)>) -- Safari
4343
- ...Obstajajo še druga imena kot je "ChakraCore" za Microsoft Edge ipd.
4444

45+
<<<<<<< HEAD
4546
Zgornja poimenovanja si velja zapomniti saj se velikokrat pojavijo v raznih
4647
člankih razvijalcev, kjer jih navadno omenjajo kadar govorijo o podpori določene
4748
funkcionalnosti. Na primer: "lastnost X je podprta na V8", kar pomeni, da to
4849
lastnost lahko uporabimo na brskalnikih Chrome in Opera.
4950

5051
```smart header="Kako delujejo programski stroji (angl. *engines*)?"
52+
=======
53+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
54+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
55+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
56+
57+
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.
58+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
5159
5260
Programski stroji so precej zahtevni za razumevanje. A osnove so enostavne.
5361
5462
1. Programski stroj prebere (angl.*parses*) skripto (v JavaScript je programski stroj največkrat kar vgrajen v spletni brskalnik, če se izvaja v spletni aplikaciji).
5563
2. Nato jo prevede (angl. *compiles*) v strojni jezik.
5664
3. Sledi izvedbe strojne kode, ki deluje zelo hitro.
5765
66+
<<<<<<< HEAD
5867
Programski stroji opravijo dodatne optimizacije ob vsakem koraku v danem procesu. Pravtako imajo možnost opazovanja in analiziranje prevedene skripte, ki se poganja, in s tem dodatno optimizira strojno kodo glede na najdbe.
68+
=======
69+
1. The engine (embedded if it's a browser) reads ("parses") the script.
70+
2. Then it converts ("compiles") the script to machine code.
71+
3. And then the machine code runs, pretty fast.
72+
73+
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.
74+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
5975
```
6076

6177
## Kaj lahko stori JavaScript, ki se izvede v spletnem brskalniku?
6278

79+
<<<<<<< HEAD
6380
Sodobni JavaScript je "varen" programski jezik. To pomeni, da ne ponuja možnosti
6481
dostopa do nizko-nivojskih funkcij spomina ali CPE, saj je bil inicialno
6582
ustvarjen za spletne brskalnike, ki pa tega ne potrebujejo.
83+
=======
84+
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.
85+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
6686
6787
Sposobnosti JavaScript-a so močno odvisne od okolja v katerem se poganja. Na
6888
primer [Node.js](https://wikipedia.org/wiki/Node.js) podpira funkcije, ki
@@ -89,7 +109,11 @@ Omejitve JavaScript-a, ki se izvaja v spletnem brskalniku so predvsem zaradi
89109
varnosti uporabnika. Cilj je preprečiti zlonamernim spletnim stranem dostop do
90110
ali neželjeno manipulacijo zasebnih podatkov uporabnika.
91111

112+
<<<<<<< HEAD
92113
Primeri takih omejitev vključujejo:
114+
=======
115+
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.
116+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
93117
94118
- JavaScript na spletni strani ne more brati/pisati/kopirati ali izvajati
95119
poljubnih datotek na trdem disku. Nima neposrednega dostopa do funkcij
@@ -107,6 +131,7 @@ Primeri takih omejitev vključujejo:
107131

108132
Izjeme:
109133

134+
<<<<<<< HEAD
110135
- Sodobni brskalniki do določene mere dovolijo delo z datotekami, vendar dostop
111136
je omejen ter omogoče le če uporabnik naredi določeno akcijo kot je npr.:
112137
nalaganje datoteke v brskalnik preko "drop" funkcionalnosti ali pa preko
@@ -122,23 +147,48 @@ Izjeme:
122147
Takšne omejitve ne obstajajo, če se JavaScript požene izven brskalnika (na
123148
primer na strežniku). Sodobni brskalniki pravtako omogočajo vtičnike, ki lahko
124149
zahtevajo za dodatna dovoljenja.
150+
=======
151+
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.
152+
153+
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).
154+
- 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).
155+
156+
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.
157+
158+
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.
159+
- 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.
160+
161+
![](limitations.svg)
162+
163+
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.
164+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
125165
126166
## Kaj je unikatnega pri JavaScript-u?
127167

128168
Obstajajo vsaj _tri_ odlične stvari o JavaScript-u:
129169

130170
```compare
171+
<<<<<<< HEAD
131172
+ Popolna integracija s HTML in CSS.
132173
+ Enostavne stvari so izvedene preprosto.
133174
+ Podpora v vseh glavnih brskalnikih, kjer je tudi samodejno omogočen.
175+
=======
176+
+ Full integration with HTML/CSS.
177+
+ Simple things are done simply.
178+
+ Supported by all major browsers and enabled by default.
179+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
134180
```
135181

136182
JavaScript je edina tehnologija v brskalnikih ki omogoča vse troje hkrati in to
137183
naredi JavaScript unikatnega. Zaradi tega je najbolj uporabljeno orodje za
138184
ustvarjanje brskalniških vmesnikov.
139185

186+
<<<<<<< HEAD
140187
Z JavaScript lahko pravtako razvijamo spletne strežnike, mobilne aplikacije,
141188
itd.
189+
=======
190+
That said, JavaScript can be used to create servers, mobile applications, etc.
191+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
142192
143193
## Programski jeziki, katerih se prevedejo v JavaScript
144194

@@ -149,9 +199,13 @@ različne za vsakogar.
149199
Tako se je nedavno razvilo ogromno število novih programskih jezikov, ki se na
150200
koncu prevedejo v JavaScript, preden se izvedejov spletnem brskalniku.
151201

202+
<<<<<<< HEAD
152203
Sodobna orodja omogočajo zelo hitro in transparentno prevajanje, kar omogoča
153204
razvijalcem programiranje v drugem programskem jeziku, vmes pa se le-ta
154205
avtomatično prevaja v JavaScript.
206+
=======
207+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
208+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
155209
156210
Nekaj primerov takšnih programskih jezikov:
157211

@@ -173,6 +227,7 @@ Nekaj primerov takšnih programskih jezikov:
173227
jedrnat in varen programski jezik, ki se lahko tudi uporablja za razvoj
174228
spletnih aplikacij ali strežnikov.
175229

230+
<<<<<<< HEAD
176231
Obstaja jih še več. Kljub temu, da obstaja več prevedenih programskih jezikov za
177232
JavaScript, je le-ta tisti, ki se na koncu izvede torej je potrebno dobro znanje
178233
samega JavaScript-a za dosledno razumevanje naših aplikacij.
@@ -186,3 +241,19 @@ samega JavaScript-a za dosledno razumevanje naših aplikacij.
186241
- Obstaja veliko programskih jezikov ki se prevedejo v JavaScript in ponujajo
187242
določene funkcionalnosti. Po spoznavanju JavaScript-a ja zaželjeno, da se
188243
spoznamo tudi s kakšnim izmed njih.
244+
=======
245+
- [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.
246+
- [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.
247+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
248+
- [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.
249+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
250+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
251+
252+
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.
253+
254+
## Summary
255+
256+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
257+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
258+
- 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.
259+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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

@@ -19,19 +19,19 @@ Also, if you're developing for the browser, then there are other specifications
1919

2020
- **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.
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.
2525

2626
## Compatibility tables
2727

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

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

32-
- <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>.
3333
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
3434

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

3737
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To see errors and get a lot of other useful information about scripts, "develope
88

99
Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific.
1010

11-
Developer tools are potent, they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
11+
Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
1212

1313
## Google Chrome
1414

@@ -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
Loading
48.3 KB
Loading
-67.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)