You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Vim](https://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
56
+
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
49
57
50
58
## Ας μην διαφωνούμε
51
59
52
60
Οι επεξεργαστές κώδικα στις παραπάνω λίστες είναι εκείνοι που είτε εγώ είτε οι φίλοι μου τους οποίους θεωρώ καλούς προγραμματιστές έχουν χρησιμοποιήσει για μεγάλο χρονικό διάστημα και είναι ευχαριστημένοι.
53
61
54
62
Υπάρχουν και άλλοι σπουδαίοι επεξεργαστές κώδικα στον κόσμο μας. Παρακαλώ επιλέξτε αυτό που σας αρέσει περισσότερο.
55
63
64
+
<<<<<<< HEAD
56
65
Η επιλογή ενός επεξεργαστή κώδικα, όπως και κάθε άλλο εργαλείο, είναι ατομική και εξαρτάται από τα έργα, τις συνήθειες και τις προσωπικές σας προτιμήσεις.
66
+
=======
67
+
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
68
+
69
+
The author's personal opinion:
70
+
71
+
- I'd use [Visual Studio Code](https://code.visualstudio.com/) if I develop mostly frontend.
72
+
- 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).
Εδώ έχουμε μια σταθερή ημερομηνία "birthday" και η "age" υπολογίζεται από "birthday" με τη βοήθεια κάποιου κωδικού (δεν παρέχεται για βραχύτητα και επειδή οι λεπτομέρειες δεν έχουν σημασία εδώ).
17
+
=======
18
+
Here we have a constant `birthday` for the date, and also the `age` constant.
19
+
20
+
The `age` is calculated from `birthday` using `someCode()`, which means a function call that we didn't explain yet (we will soon!), but the details don't matter here, the point is that `age` is calculated somehow based on the `birthday`.
21
+
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
16
22
17
23
Θα ήταν σωστό να χρησιμοποιήσετε κεφαλαία γράμματα για τα `birthday`; Για `age`; Ή ακόμα και για τα δύο;
18
24
19
25
```js
26
+
<<<<<<<HEAD
20
27
constBIRTHDAY='18.04.1982'; // Με κεφαλαία?
21
28
22
29
constAGE=someCode(BIRTHDAY); // Με κεφαλαία?
23
-
```
30
+
=======
31
+
constBIRTHDAY='18.04.1982'; // make birthday uppercase?
24
32
33
+
constAGE=someCode(BIRTHDAY); // make age uppercase?
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/04-variables/article.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,11 @@ let message = "That"; // SyntaxError: 'message' has already been declared
161
161
````
162
162
163
163
```smart header="Functional languages"
164
+
<<<<<<< HEAD
164
165
Είναι ενδιαφέρον να σημειωθεί ότι υπάρχουν [functional](https://en.wikipedia.org/wiki/Functional_programming) γλώσσες προγραμματισμού, όπως [Scala](http://www.scala-lang.org/) ή [Erlang](http://www.erlang.org/) που απαγορεύουν την αλλαγή τιμής στις μεταβλητές.
166
+
=======
167
+
It's interesting to note that there exist [functional](https://en.wikipedia.org/wiki/Functional_programming) programming languages, like [Scala](https://www.scala-lang.org/) or [Erlang](https://www.erlang.org/) that forbid changing variable values.
168
+
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
165
169
166
170
Σε τέτοιες γλώσσες, όταν η τιμή αποθηκευτεί "στο κουτί", είναι εκεί για πάντα. Εάν χρειαστεί να αποθηκεύσουμε κάτι άλλο, η γλώσσα μας αναγκάζει να δημιουργήσουμε ένα νέο πλαίσιο (δηλώστε μια νέα μεταβλητή). Δεν μπορούμε να επαναχρησιμοποιήσουμε το παλιό.
167
171
@@ -212,7 +216,11 @@ Variables named `apple` and `APPLE` are two different variables.
212
216
```
213
217
214
218
````smart header="Non-Latin letters are allowed, but not recommended"
219
+
<<<<<<< HEAD
215
220
Είναι δυνατή η χρήση οποιασδήποτε γλώσσας, συμπεριλαμβανομένων κυριλλικών γραμμάτων ή ακόμη και ιερογλυφικών, όπως αυτή:
221
+
=======
222
+
It is possible to use any language, including cyrillic letters, Chinese logograms and so on, like this:
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/08-operators/3-primitive-conversions-questions/solution.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,10 +16,20 @@ undefined + 1 = NaN // (6)
16
16
"\t\n"-2=-2// (7)
17
17
```
18
18
19
+
<<<<<<< HEAD
19
20
1. Η πρόσθεση με μια συμβολοσειρά όπως π.χ. `"" + 1`, μετατρέπει το `1` σε μια συμβολοσειρά: `"" + 1 = "1"`, και τότε έχουμε `"1" + 0`, όπου ο ίδιος κανόνας εφαρμόζεται.
20
21
2. Η αφαίρεση `-` (όπως στις περισσότερες Μαθηματικές πράξεις) λειτουργεί μόνο με αριθμούς, και μετατρέπει μια άδεια συμβολοσειρά `""` σε `0`.
21
22
3. Η πρόσθεση με μια συμβολοσειρά, τοποθετεί τον αριθμό `5` στη συμβολοσειρά (επιπλέον παράδειγμα: `5 +"9" = "59"`).
22
23
4. Η αφαίρεση μετατρέπει τις τιμές πάντα σε αριθμούς, επομένως εδώ μετατρέπει το `" -9 "` στον αριθμό `-9` (αγνοώντας τα κενά γύρω του).
23
24
5. Η `null` γίνεται `0` μετά την αριθμητική μετατροπή.
24
25
6. Η `undefined` γίνεται `NaN` μετά την αριθμητική μετατροπή.
25
26
27
+
=======
28
+
1. The addition with a string `"" + 1` converts `1` to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
29
+
2. The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""` to `0`.
30
+
3. The addition with a string appends the number `5` to the string.
31
+
4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it).
32
+
5.`null` becomes `0` after the numeric conversion.
33
+
6.`undefined` becomes `NaN` after the numeric conversion.
34
+
7. Space characters are trimmed off string start and end when a string is converted to a number. Here the whole string consists of space characters, such as `\t`, `\n` and a "regular" space between them. So, similarly to an empty string, it becomes `0`.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/15-function-basics/article.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,7 +215,42 @@ function showMessage(from, text = anotherFunction()) {
215
215
216
216
Μερικές φορές έχει νόημα να ορίσετε προεπιλεγμένες τιμές για παραμέτρους όχι στη δήλωση συνάρτησης, αλλά σε μεταγενέστερο στάδιο, κατά την εκτέλεση.
217
217
218
+
<<<<<<< HEAD
218
219
Για να ελέγξουμε μια παράμετρο που παραλείφθηκε, μπορούμε να τη συγκρίνουμε με το `undefined`:
220
+
=======
221
+
For example, an explicit check for `undefined`:
222
+
223
+
```js
224
+
function showMessage(from, text) {
225
+
*!*
226
+
if (text === undefined) {
227
+
text = 'notextgiven';
228
+
}
229
+
*/!*
230
+
231
+
alert( from + ": " + text );
232
+
}
233
+
```
234
+
235
+
...Or using the `||` operator:
236
+
237
+
```js
238
+
function showMessage(from, text) {
239
+
// If the value of text is falsy, assign the default value
240
+
// this assumes that text == "" is the same as no text at all
241
+
text = text || 'notextgiven';
242
+
...
243
+
}
244
+
```
245
+
````
246
+
247
+
248
+
### Alternative default parameters
249
+
250
+
Sometimes it makes sense to assign default values for parameters at a later stage after the function declaration.
251
+
252
+
We can check if the parameter is passed during the function execution, by comparing it with `undefined`:
253
+
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
219
254
220
255
```js run
221
256
function showMessage(text) {
@@ -408,7 +443,11 @@ checkPermission(..) // ελέγχει μια συναίνεση, επιστρέ
408
443
```smart header="'Ονομα συνάρτησης Ultrashort"
409
444
Οι συναρτήσεις που χρησιμοποιούνται *πολύ συχνά* μερικές φορές έχουν συντομα ονόματα.
410
445
446
+
<<<<<<< HEAD
411
447
Για παράδειγμα το [jQuery](http://jquery.com) βιβλιοθήκη ορίζει μια συνάρτηση με `$`. Το [Lodash](http://lodash.com/) βιβλιοθήκη δηλώνει τις συναρτήσεις με `_`.
448
+
=======
449
+
For example, the [jQuery](https://jquery.com/) framework defines a function with `$`. The [Lodash](https://lodash.com/) library has its core function named `_`.
450
+
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
412
451
413
452
Αυτές είναι εξαιρέσεις. Γενικά τα ονόματα των συναρτήσεων πρέπει να είναι συνοπτικά και περιγραφικά.
Copy file name to clipboardExpand all lines: 1-js/03-code-quality/05-testing-mocha/article.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ The flow of development usually looks like this:
69
69
70
70
1. An initial spec is written, with tests for the most basic functionality.
71
71
2. An initial implementation is created.
72
-
3. To check whether it works, we run the testing framework [Mocha](http://mochajs.org/) (more details soon) that runs the spec. While the functionality is not complete, errors are displayed. We make corrections until everything works.
72
+
3. To check whether it works, we run the testing framework [Mocha](https://mochajs.org/) (more details soon) that runs the spec. While the functionality is not complete, errors are displayed. We make corrections until everything works.
73
73
4. Now we have a working initial implementation with tests.
74
74
5. We add more use cases to the spec, probably not yet supported by the implementations. Tests start to fail.
75
75
6. Go to 3, update the implementation till tests give no errors.
@@ -85,9 +85,9 @@ The first step is already complete: we have an initial spec for `pow`. Now, befo
85
85
86
86
Here in the tutorial we'll be using the following JavaScript libraries for tests:
87
87
88
-
-[Mocha](http://mochajs.org/) -- the core framework: it provides common testing functions including `describe` and `it` and the main function that runs tests.
89
-
-[Chai](http://chaijs.com) -- the library with many assertions. It allows to use a lot of different assertions, for now we need only `assert.equal`.
90
-
-[Sinon](http://sinonjs.org/) -- a library to spy over functions, emulate built-in functions and more, we'll need it much later.
88
+
-[Mocha](https://mochajs.org/) -- the core framework: it provides common testing functions including `describe` and `it` and the main function that runs tests.
89
+
-[Chai](https://www.chaijs.com/) -- the library with many assertions. It allows to use a lot of different assertions, for now we need only `assert.equal`.
90
+
-[Sinon](https://sinonjs.org/) -- a library to spy over functions, emulate built-in functions and more, we'll need it much later.
91
91
92
92
These libraries are suitable for both in-browser and server-side testing. Here we'll consider the browser variant.
93
93
@@ -338,14 +338,14 @@ The newly added tests fail, because our implementation does not support them. Th
338
338
```smart header="Other assertions"
339
339
Please note the assertion `assert.isNaN`: it checks for `NaN`.
340
340
341
-
There are other assertions in [Chai](http://chaijs.com) as well, for instance:
341
+
There are other assertions in [Chai](https://www.chaijs.com/) as well, for instance:
342
342
343
343
- `assert.equal(value1, value2)` -- checks the equality `value1 == value2`.
Copy file name to clipboardExpand all lines: 1-js/03-code-quality/06-polyfills/article.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
2
2
# Polyfills and transpilers
3
3
4
-
The JavaScript language steadily evolves. New proposals to the language appear regularly, they are analyzed and, if considered worthy, are appended to the list at <https://tc39.github.io/ecma262/> and then progress to the [specification](http://www.ecma-international.org/publications/standards/Ecma-262.htm).
4
+
The JavaScript language steadily evolves. New proposals to the language appear regularly, they are analyzed and, if considered worthy, are appended to the list at <https://tc39.github.io/ecma262/> and then progress to the [specification](https://www.ecma-international.org/publications-and-standards/standards/ecma-262/).
5
5
6
6
Teams behind JavaScript engines have their own ideas about what to implement first. They may decide to implement proposals that are in draft and postpone things that are already in the spec, because they are less interesting or just harder to do.
7
7
@@ -73,7 +73,7 @@ JavaScript is a highly dynamic language. Scripts may add/modify any function, ev
73
73
74
74
Two interesting polyfill libraries are:
75
75
- [core js](https://github.com/zloirock/core-js) that supports a lot, allows to include only needed features.
76
-
- [polyfill.io](http://polyfill.io) service that provides a script with polyfills, depending on the features and user's browser.
76
+
- [polyfill.io](https://polyfill.io/) service that provides a script with polyfills, depending on the features and user's browser.
0 commit comments