Skip to content

Commit 41ccb57

Browse files
committed
merging all conflicts
2 parents cd5180c + 8d9ecb7 commit 41ccb57

13 files changed

Lines changed: 85 additions & 83 deletions

File tree

1-js/02-first-steps/05-types/article.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ alert(age); // "undefined"
236236
237237
## Ο τελεστής `typeof` [#type-typeof]
238238
239+
<<<<<<< HEAD
239240
Ο τελεστής `typeof` επιστρέφει τον τύπο του ορίσματος. Είναι χρήσιμο όταν θέλουμε να επεξεργαστούμε διαφορετικές τιμές διαφορετικών τύπων ή απλώς να κάνουμε έναν γρήγορο έλεγχο.
241+
=======
242+
The `typeof` operator returns the type of the operand. It's useful when we want to process values of different types differently or just want to do a quick check.
243+
>>>>>>> 8d9ecb724c7df59774d1e5ffb5e5167740b7d321
240244

241245
Υποστηρίζει δύο μορφές σύνταξης:
242246

1-js/02-first-steps/08-operators/article.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@
4949

5050
Για παράδειγμα:
5151
```js run
52+
<<<<<<< HEAD
5253
alert( 5 % 2 ); // 1, ένα υπόλοιπο 5 διαιρούμενο με 2
5354
alert( 8 % 3 ); // 2, ένα υπόλοιπο 8 διαιρούμενο με 3
55+
=======
56+
alert( 5 % 2 ); // 1, a remainder of 5 divided by 2
57+
alert( 8 % 3 ); // 2, a remainder of 8 divided by 3
58+
alert( 8 % 4 ); // 2, 0 remainder of 8 divided by 4
59+
>>>>>>> 8d9ecb724c7df59774d1e5ffb5e5167740b7d321
5460
```
5561

5662
### Εκθετικό **
@@ -65,7 +71,11 @@ alert( 2 ** 3 ); // 8 (2 * 2 * 2, 3 φορές)
6571
alert( 2 ** 4 ); // 16 (2 * 2 * 2 * 2, 4 φορές)
6672
```
6773

74+
<<<<<<< HEAD
6875
Μαθηματικά, ο εκθετικός ορίζεται και για μη ακέραιους αριθμούς. Για παράδειγμα, μια τετραγωνική ρίζα εκτείνεται με το `1/2`:
76+
=======
77+
Just like in maths, the exponentiation operator is defined for non-integer numbers as well.
78+
>>>>>>> 8d9ecb724c7df59774d1e5ffb5e5167740b7d321
6979

7080

7181
```js run
@@ -302,7 +312,12 @@ let n = 2;
302312
303313
n *= 3 + 5; // right part evaluated first, same as n *= 8
304314
315+
<<<<<<< HEAD
305316
alert( n ); // 16 (το σωστό μέρος αξιολογήθηκε πρώτα, το ίδια και για το n *= 8)
317+
=======
318+
alert( n ); // 16
319+
```
320+
>>>>>>> 8d9ecb724c7df59774d1e5ffb5e5167740b7d321
306321
307322
## Αύξηση/μείωση
308323

1-js/02-first-steps/12-nullish-coalescing-operator/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ alert(user ?? "Anonymous"); // Anonymous (user is undefined)
3232
```js run
3333
let user = "John";
3434

35-
alert(user ?? "Anonymous"); // John (user is not null/udefined)
35+
alert(user ?? "Anonymous"); // John (user is not null/undefined)
3636
```
3737
3838
Μπορούμε επίσης να χρησιμοποιήσουμε μια ακολουθία του `??` για να επιλέξουμε την πρώτη τιμή από μια λίστα που δεν είναι `null/undefined`.

1-js/04-object-basics/09-object-toprimitive/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ As we know already, many operators and functions perform type conversions, e.g.
226226

227227
If we pass an object as an argument, then there are two stages of calculations:
228228
1. The object is converted to a primitive (using the rules described above).
229-
2. If the necessary for further calculations, the resulting primitive is also converted.
229+
2. If necessary for further calculations, the resulting primitive is also converted.
230230

231231
For instance:
232232

1-js/05-data-types/03-string/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ This method actually has two additional arguments specified in [the documentatio
505505
506506
- There are 3 types of quotes. Backticks allow a string to span multiple lines and embed expressions `${…}`.
507507
- We can use special characters, such as a line break `\n`.
508-
- To get a character, use: `[]`.
508+
- To get a character, use: `[]` or `at` method.
509509
- To get a substring, use: `slice` or `substring`.
510510
- To lowercase/uppercase a string, use: `toLowerCase/toUpperCase`.
511511
- To look for a substring, use: `indexOf`, or `includes/startsWith/endsWith` for simple checks.
@@ -519,4 +519,4 @@ There are several other helpful methods in strings:
519519
520520
Strings also have methods for doing search/replace with regular expressions. But that's big topic, so it's explained in a separate tutorial section <info:regular-expressions>.
521521
522-
Also, as of now it's important to know that strings are based on Unicode encoding, and hence there're issues with comparisons. There's more about Unicode in the chapter <info:unicode>.
522+
Also, as of now it's important to know that strings are based on Unicode encoding, and hence there're issues with comparisons. There's more about Unicode in the chapter <info:unicode>.

1-js/05-data-types/07-map-set/article.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ But that's not enough for real life. That's why `Map` and `Set` also exist.
1010

1111
## Map
1212

13-
[Map](mdn:js/Map) is a collection of keyed data items, just like an `Object`. But the main difference is that `Map` allows keys of any type.
13+
[Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) is a collection of keyed data items, just like an `Object`. But the main difference is that `Map` allows keys of any type.
1414

1515
Methods and properties are:
1616

17-
- `new Map()` -- creates the map.
18-
- [`map.set(key, value)`](mdn:js/Map/set) -- stores the value by the key.
19-
- [`map.get(key)`](mdn:js/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
20-
- [`map.has(key)`](mdn:js/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
21-
- [`map.delete(key)`](mdn:js/Map/delete) -- removes the value by the key.
22-
- [`map.clear()`](mdn:js/Map/clear) -- removes everything from the map.
23-
- [`map.size`](mdn:js/Map/size) -- returns the current element count.
17+
- [`new Map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/Map) -- creates the map.
18+
- [`map.set(key, value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set) -- stores the value by the key.
19+
- [`map.get(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
20+
- [`map.has(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
21+
- [`map.delete(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete) -- removes the value by the key.
22+
- [`map.clear()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear) -- removes everything from the map.
23+
- [`map.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size) -- returns the current element count.
2424

2525
For instance:
2626

@@ -100,14 +100,13 @@ map.set('1', 'str1')
100100
```
101101
````
102102
103-
104103
## Iteration over Map
105104
106105
For looping over a `map`, there are 3 methods:
107106
108-
- [`map.keys()`](mdn:js/Map/keys) -- returns an iterable for keys,
109-
- [`map.values()`](mdn:js/Map/values) -- returns an iterable for values,
110-
- [`map.entries()`](mdn:js/Map/entries) -- returns an iterable for entries `[key, value]`, it's used by default in `for..of`.
107+
- [`map.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys) -- returns an iterable for keys,
108+
- [`map.values()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values) -- returns an iterable for values,
109+
- [`map.entries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries) -- returns an iterable for entries `[key, value]`, it's used by default in `for..of`.
111110
112111
For instance:
113112
@@ -162,7 +161,7 @@ let map = new Map([
162161
alert( map.get('1') ); // str1
163162
```
164163
165-
If we have a plain object, and we'd like to create a `Map` from it, then we can use built-in method [Object.entries(obj)](mdn:js/Object/entries) that returns an array of key/value pairs for an object exactly in that format.
164+
If we have a plain object, and we'd like to create a `Map` from it, then we can use built-in method [Object.entries(obj)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries) that returns an array of key/value pairs for an object exactly in that format.
166165
167166
So we can create a map from an object like this:
168167
@@ -233,16 +232,16 @@ That's the same, because `Object.fromEntries` expects an iterable object as the
233232
234233
## Set
235234
236-
A `Set` is a special type collection - "set of values" (without keys), where each value may occur only once.
235+
A [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) is a special type collection - "set of values" (without keys), where each value may occur only once.
237236
238237
Its main methods are:
239238
240-
- `new Set(iterable)` -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
241-
- [`set.add(value)`](mdn:js/Set/add) -- adds a value, returns the set itself.
242-
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
243-
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
244-
- [`set.clear()`](mdn:js/Set/clear) -- removes everything from the set.
245-
- [`set.size`](mdn:js/Set/size) -- is the elements count.
239+
- [`new Set([iterable])`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set) -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
240+
- [`set.add(value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) -- adds a value, returns the set itself.
241+
- [`set.delete(value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
242+
- [`set.has(value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
243+
- [`set.clear()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) -- removes everything from the set.
244+
- [`set.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) -- is the elements count.
246245
247246
The main feature is that repeated calls of `set.add(value)` with the same value don't do anything. That's the reason why each value appears in a `Set` only once.
248247
@@ -272,7 +271,7 @@ for (let user of set) {
272271
}
273272
```
274273
275-
The alternative to `Set` could be an array of users, and the code to check for duplicates on every insertion using [arr.find](mdn:js/Array/find). But the performance would be much worse, because this method walks through the whole array checking every element. `Set` is much better optimized internally for uniqueness checks.
274+
The alternative to `Set` could be an array of users, and the code to check for duplicates on every insertion using [arr.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find). But the performance would be much worse, because this method walks through the whole array checking every element. `Set` is much better optimized internally for uniqueness checks.
276275
277276
## Iteration over Set
278277
@@ -295,38 +294,38 @@ That's for compatibility with `Map` where the callback passed `forEach` has thre
295294
296295
The same methods `Map` has for iterators are also supported:
297296
298-
- [`set.keys()`](mdn:js/Set/keys) -- returns an iterable object for values,
299-
- [`set.values()`](mdn:js/Set/values) -- same as `set.keys()`, for compatibility with `Map`,
300-
- [`set.entries()`](mdn:js/Set/entries) -- returns an iterable object for entries `[value, value]`, exists for compatibility with `Map`.
297+
- [`set.keys()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/keys) -- returns an iterable object for values,
298+
- [`set.values()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/values) -- same as `set.keys()`, for compatibility with `Map`,
299+
- [`set.entries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries) -- returns an iterable object for entries `[value, value]`, exists for compatibility with `Map`.
301300
302301
## Summary
303302
304-
`Map` -- is a collection of keyed values.
303+
[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) -- is a collection of keyed values.
305304
306305
Methods and properties:
307306
308-
- `new Map([iterable])` -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization.
309-
- [`map.set(key, value)`](mdn:js/Map/set) -- stores the value by the key, returns the map itself.
310-
- [`map.get(key)`](mdn:js/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
311-
- [`map.has(key)`](mdn:js/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
312-
- [`map.delete(key)`](mdn:js/Map/delete) -- removes the value by the key, returns `true` if `key` existed at the moment of the call, otherwise `false`.
313-
- [`map.clear()`](mdn:js/Map/clear) -- removes everything from the map.
314-
- [`map.size`](mdn:js/Map/size) -- returns the current element count.
307+
- [`new Map([iterable])`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/Map) -- creates the map, with optional `iterable` (e.g. array) of `[key,value]` pairs for initialization.
308+
- [`map.set(key, value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set) -- stores the value by the key, returns the map itself.
309+
- [`map.get(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get) -- returns the value by the key, `undefined` if `key` doesn't exist in map.
310+
- [`map.has(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has) -- returns `true` if the `key` exists, `false` otherwise.
311+
- [`map.delete(key)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete) -- removes the value by the key, returns `true` if `key` existed at the moment of the call, otherwise `false`.
312+
- [`map.clear()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear) -- removes everything from the map.
313+
- [`map.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size) -- returns the current element count.
315314
316315
The differences from a regular `Object`:
317316
318317
- Any keys, objects can be keys.
319318
- Additional convenient methods, the `size` property.
320319
321-
`Set` -- is a collection of unique values.
320+
[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) -- is a collection of unique values.
322321
323322
Methods and properties:
324323
325-
- `new Set([iterable])` -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
326-
- [`set.add(value)`](mdn:js/Set/add) -- adds a value (does nothing if `value` exists), returns the set itself.
327-
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
328-
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
329-
- [`set.clear()`](mdn:js/Set/clear) -- removes everything from the set.
330-
- [`set.size`](mdn:js/Set/size) -- is the elements count.
324+
- [`new Set([iterable])`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/Set) -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
325+
- [`set.add(value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/add) -- adds a value (does nothing if `value` exists), returns the set itself.
326+
- [`set.delete(value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
327+
- [`set.has(value)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
328+
- [`set.clear()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear) -- removes everything from the set.
329+
- [`set.size`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/size) -- is the elements count.
331330
332331
Iteration over `Map` and `Set` is always in the insertion order, so we can't say that these collections are unordered, but we can't reorder elements or directly get an element by its number.

0 commit comments

Comments
 (0)