Skip to content

Commit 856e61e

Browse files
committed
merging all conflicts
2 parents 913687b + 3dd8ca0 commit 856e61e

521 files changed

Lines changed: 12701 additions & 7324 deletions

File tree

Some content is hidden

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

‎.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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ La oss se litt nærmere på hva som er så spesielt med JavaScript, hva vi kan o
66

77
## Hva er JavaScript?
88

9+
<<<<<<< HEAD
910
*JavaScript* var egentlig ment for å *"gi hjemmesider mer liv"*.
11+
=======
12+
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.
13+
>>>>>>> 3dd8ca09c1a7ed7a7b04eefc69898559902478e1
1014
1115
Programmer skrevet i JavaScript kalles for *scripts*. De kan skrives rett inn i en nettsides's HTML og kjører automatisk så fort siden blir lastet.
1216

@@ -75,11 +79,19 @@ Eksempler på slike begrensninger inkluderer:
7579

7680
- Forskjellige paneler/vinduer i en nettleser vet i utgangspunktet ingenting om hverandre. Noenganger gjør de det, for eksempel når et vindu bruker JavaScript til å åpne et annet vindu. Men selv i dette tilfellet, JavaScript fra en side til en kan ikke aksessere et annet vindu hvis det kommer fra forskjellige sider (fra et annet domene, protokoll eller port).
7781

82+
<<<<<<< HEAD
7883
Dette er kalt "Same Origin Policy". For å jobbe rundt dette, må *begge sidene* inneholde en spesiell JavaScript kode som behandler denne utvekslingen av data.
84+
=======
85+
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.
86+
>>>>>>> 3dd8ca09c1a7ed7a7b04eefc69898559902478e1
7987
8088
Denne begrensningen er, igjen satt på plass med brukerens trygghet i tankene. En side fra `http://hvilkensomhelstside.no` som en bruker har åpnet kan overhodet ikke være i stand til å aksessere et annet panel med URL'en `http://gmail.com` og stjele informasjon derfra.
8189

90+
<<<<<<< HEAD
8291
- JavaScript kan med letthet kommunisere med en tjener over nettet hvor den nåværende siden kom fra. Men dets egenskap til å motta data fra andre sider/domener er veldig tungvint, men det er mulig, dette krever eksplisitt tillatelse (uttrykt via HTTP headere) fra den eksterne siden. Igjen, dette er sikkerhetsbegrensning.
92+
=======
93+
![](limitations.svg)
94+
>>>>>>> 3dd8ca09c1a7ed7a7b04eefc69898559902478e1
8395
8496
![](limitations.svg)
8597

@@ -96,9 +108,13 @@ Dette er de *tre* minst gode ting om JavaScript:
96108
```
97109
JavaScript er den eneste nettleser teknologien som kombinerer disse tre tingene.
98110

111+
<<<<<<< HEAD
99112
Dette er det som gjør JavaScript unikt. Dette er grunnen til at JavaScript er det mest utstrakte verktøyet for utvikling av grensesnitt i nettleseren.
100113

101114
Imens du har planer om å lære deg en teknologi, er det gunstig å sjekke dens perspektiver. Så la oss fortsette til de moderne trendene som påvirker den, inkluderende nye språk og ny nettleser-funksjonalitet.
115+
=======
116+
That said, JavaScript also allows to create servers, mobile applications, etc.
117+
>>>>>>> 3dd8ca09c1a7ed7a7b04eefc69898559902478e1
102118
103119
## Språk "via" JavaScript
104120

@@ -112,11 +128,20 @@ Moderne verktøy gjør transpileringen veldig rask og forutsigbar, faktisk så l
112128

113129
Dette er eksempler på slike språk:
114130

131+
<<<<<<< HEAD
115132
- [CoffeeScript](http://coffeescript.org/) er en "syntaktisk sukker" for JavaScript. Det introduserer kortere syntax, som lar oss skrive klarer og mer presis kode. Ruby utviklere er vanligvis mer glad i dette.
116133
- [TypeScript](http://www.typescriptlang.org/) er konsentrert rundt å legge til "streng datatyping" for å gjøre utvikling og drifting av komplekse systemer lettere. TypeScript er utviklet av Microsoft.
117134
- [Dart](https://www.dartlang.org/) er et selvstendig språk som har sin egen motor som kjører ukjente miljøer for nettleseren (som mobilapplikasjoner). Det var i utgangspunktet lagt frem av Google som en erstatter for JavaScript, men foreløpig krever nettlesere at Dart transpileres til JavaScript akkurat som de andre nevnt ovenfor.
118135

119136
Det finnes flere selvfølgelig. Men selv om vi bruker noen av disse språkene, er det lurt av oss å kjenne JavaScript for å vite hva vi egentlig driver med.
137+
=======
138+
- [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.
139+
- [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.
140+
- [Flow](http://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
141+
- [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.
142+
143+
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.
144+
>>>>>>> 3dd8ca09c1a7ed7a7b04eefc69898559902478e1
120145
121146
## Summary
122147
## Oppsummering
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# Manuals and specifications
3+
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.
5+
6+
## Specification
7+
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.
9+
10+
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.
11+
12+
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
13+
14+
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>.
15+
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.
17+
18+
## Manuals
19+
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.
21+
22+
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
23+
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".
30+
31+
## Compatibility tables
32+
33+
JavaScript is a developing language, new features get added regularly.
34+
35+
To see their support among browser-based and other engines, see:
36+
37+
- <http://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <http://caniuse.com/#feat=cryptography>.
38+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
39+
40+
All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.
41+
42+
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ An IDE loads the project (which can be many files), allows navigation between fi
1212

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

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

18-
All of these IDEs are cross-platform.
18+
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

20-
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/).
21-
22-
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.
20+
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.
2321

2422
## Lightweight editors
2523

@@ -33,21 +31,11 @@ In practice, lightweight editors may have a lot of plugins including directory-l
3331

3432
The following options deserve your attention:
3533

36-
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free) also has many IDE-like features.
3734
- [Atom](https://atom.io/) (cross-platform, free).
3835
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
3936
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
4037
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
4138

42-
## My favorites
43-
44-
The personal preference of the author is to have both an IDE for projects and a lightweight editor for quick and easy file editing.
45-
46-
I'm using:
47-
48-
- As an IDE for JS -- [WebStorm](http://www.jetbrains.com/webstorm/) (I switch to one of the other JetBrains offerings when using other languages)
49-
- As a lightweight editor -- [Sublime Text](http://www.sublimetext.com) or [Atom](https://atom.io/).
50-
5139
## Let's not argue
5240

5341
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.
-105 KB
Binary file not shown.
-285 KB
Binary file not shown.

1-js/01-getting-started/3-devtools/article.md renamed to 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

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)