Skip to content

Sync with upstream @ b258d7d5 #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cd86528
Fix typo
wdscxsj Oct 3, 2022
165a3f5
typo "optimzed
joaquinelio Oct 3, 2022
f0fa52f
Fix typo
wdscxsj Oct 4, 2022
88d9b3f
removed -> remove; optimzed -> optimized ;
sagarpanchal Jan 18, 2023
023c0ec
Fixing a minor grammatical typo in the document.
rahulrao0209 Jul 16, 2023
8ab6b39
Add WeakRef and FinalizationRegistry article
WOLFRIEND Nov 4, 2023
5ab1ce2
Merge pull request #3609 from WOLFRIEND/master
iliakan Nov 15, 2023
b7ebc1b
Improve awkward sentence structure
smith558 Nov 24, 2023
75bad83
Improve grammar
smith558 Nov 24, 2023
74a8a19
Fix formatting char
smith558 Nov 27, 2023
d51037a
Fix grammar and add an example
nakhodkin Dec 27, 2023
c66bace
Fix grammar and typos
nakhodkin Dec 31, 2023
bbac8a5
Fix grammar and JavaScript syntax
nakhodkin Jan 2, 2024
1b9a28b
Update article.md
JaFro96 Jan 4, 2024
4ec440f
Update article.md
JaFro96 Jan 4, 2024
d83bfb2
refactor: Updated RFC spec Safe Methods URL in Cookies chapter
alexandermirzoyan Jan 12, 2024
9ec34c6
Replace assignment with equals in Truncate the text task
CJDumbleton Jan 17, 2024
2e0d5fb
Add missing word
qadzek Jan 20, 2024
52e184c
Add missing CSS unit
qadzek Jan 20, 2024
0530c92
fix square brackets
mikayel00 Jan 24, 2024
9270fe5
Merge pull request #3639 from JaFro96/master
smith558 Jan 24, 2024
f0f1006
fix: json
mikayel00 Jan 24, 2024
c98ec82
Merge pull request #3647 from CJDumbleton/CJDumbleton-patch-1
smith558 Jan 24, 2024
9c07c5b
Merge pull request #3649 from qadzek/patch-1
smith558 Jan 24, 2024
1a6edd7
Merge pull request #3656 from mikayel00/fix-brackets
smith558 Jan 26, 2024
9d157d8
Merge pull request #3617 from smith558/patch-3
smith558 Jan 27, 2024
b6c604a
Merge branch 'master' into patch-5
smith558 Jan 27, 2024
4286703
Merge pull request #3644 from alexandermirzoyan/patch-2
smith558 Jan 27, 2024
26ac4c8
Merge pull request #3212 from wdscxsj/patch-2
smith558 Jan 27, 2024
f24e463
Merge pull request #3213 from joaquinelio/patch-15
smith558 Jan 27, 2024
774d0c1
Merge pull request #3326 from sagarpanchal/patch-2
smith558 Jan 27, 2024
aacfc93
Fixed grammar error in regex-groups article.md
eedrxs Jan 27, 2024
e2ac312
Merge pull request #3659 from eedrxs/patch-1
smith558 Jan 27, 2024
ee62307
Update article.md
nepikn Feb 2, 2024
4a20875
Update article.md
smith558 Feb 11, 2024
5ce4b3a
Merge pull request #3664 from nepikn/patch-2
smith558 Feb 11, 2024
daca277
Fix grammar
smith558 Feb 11, 2024
3e92613
Improve options description
smith558 Feb 11, 2024
b6e7472
Update samesite content
smith558 Feb 13, 2024
d134cab
Remove "surely"
smith558 Feb 13, 2024
19e62af
Update article.md
smith558 Feb 13, 2024
a7d351f
change IndexedDb to IndexedDB (#3660)
0xtpsl Feb 13, 2024
ab1db04
Fix grammar and typos (#3628)
nakhodkin Feb 14, 2024
d461a93
Merge pull request #3217 from wdscxsj/patch-3
smith558 Feb 14, 2024
00bdf88
Update LICENSE.md
iliakan Mar 8, 2024
25c9bdf
Update LICENSE.md
iliakan Mar 8, 2024
c13e707
Update LICENSE.md
iliakan Mar 8, 2024
e15f535
Update LICENSE.md
iliakan Mar 8, 2024
2f91d87
Update LICENSE.md
iliakan Mar 8, 2024
ea05aa9
Updated result visualization
Filin3 Mar 31, 2024
04b73bf
Merge pull request #3681 from Filin3/patch-1
smith558 May 5, 2024
acf339c
Merge pull request #3632 from nakhodkin/patch-2
smith558 May 5, 2024
541b7f9
Merge pull request #3636 from nakhodkin/patch-5
smith558 May 5, 2024
0b9bc2f
Merge pull request #3634 from nakhodkin/patch-4
smith558 May 5, 2024
85da6f1
Update article.md
ellie-heidari May 10, 2024
475899e
Update article.md
smith558 May 17, 2024
7e524ba
Add link
smith558 May 17, 2024
42851f4
Update task.md
pvepamb1 May 18, 2024
2092da7
Merge pull request #3694 from pvepamb1/patch-1
smith558 May 18, 2024
f684d39
change example element of multidimensional array
sneeed Jun 8, 2024
c151e11
minor fixes
iliakan Jun 13, 2024
3fd3f98
- `run`
Alexandre887 Jun 23, 2024
d1ffe5d
docs: remove eval polyfill.io
kricsleo Jul 5, 2024
262f91a
Merge pull request #3712 from kricsleo/patch-1
smith558 Jul 8, 2024
815fafa
Merge pull request #3692 from ellie-heidari/patch-1
smith558 Jul 8, 2024
d6e0376
Remove BigInt IE incompatibility part (#3709)
FloffyGarlic Jul 9, 2024
5a0df77
Update article.md
shallow-beach Jul 10, 2024
62827d8
Merge pull request #3715 from shallow-beach/master
smith558 Jul 10, 2024
4104eba
Merge pull request #3704 from Alexandre887/patch-10
smith558 Jul 10, 2024
ca72abb
Merge pull request #3700 from sneeed/patch-2
smith558 Jul 10, 2024
b258d7d
Merge pull request #3495 from rahulrao0209/patch-1
smith558 Jul 10, 2024
e53344c
merging all conflicts
iliakan Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: iliakan
48 changes: 48 additions & 0 deletions 1-js/02-first-steps/04-variables/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,26 @@ let user = 'John'
*!*var*/!* message = 'Hello';
```

<<<<<<< HEAD
Η λέξη-κλειδί `var` είναι * σχεδόν * ίδια με την `let`. Δηλώνει επίσης μια μεταβλητή, αλλά με έναν ελαφρώς διαφορετικό, "παλιό τρόπο".

Υπάρχουν λεπτές διαφορές μεταξύ της `let` και της `var`, αλλά δεν έχουν σημασία αυτή τη στιγμή. Θα τα καλύψουμε λεπτομερώς στο κεφάλαιο <info:var>.
=======
The `var` keyword is *almost* the same as `let`. It also declares a variable but in a slightly different, "old-school" way.

There are subtle differences between `let` and `var`, but they do not matter to us yet. We'll cover them in detail in the chapter <info:var>.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d
````

## Η αναλογία της πραγματικότητας

Μπορούμε εύκολα να κατανοήσουμε την έννοια μιας `μεταβλητής` αν τη φανταζόμαστε ως `κουτί` για δεδομένα, μια ετικέτα με μοναδικό όνομα.

<<<<<<< HEAD
Για παράδειγμα, η μεταβλητή `message` μπορεί να φανταστεί ως ένα κουτί με την ένδειξη `message` με την τιμή `Hello!`:
=======
For instance, the variable `message` can be imagined as a box labelled `"message"` with the value `"Hello!"` in it:
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

![](variable.svg)

Expand Down Expand Up @@ -225,17 +235,26 @@ Variables named `apple` and `APPLE` are two different variables.

````smart header="Non-Latin letters are allowed, but not recommended"
<<<<<<< HEAD
<<<<<<< HEAD
Είναι δυνατή η χρήση οποιασδήποτε γλώσσας, συμπεριλαμβανομένων κυριλλικών γραμμάτων ή ακόμη και ιερογλυφικών, όπως αυτή:
=======
It is possible to use any language, including cyrillic letters, Chinese logograms and so on, like this:
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
=======
It is possible to use any language, including Cyrillic letters, Chinese logograms and so on, like this:
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

```js
let имя = '...';
let 我 = '...';
```

<<<<<<< HEAD
Από τεχνικής άποψης, δεν υπάρχει σφάλμα εδώ, τέτοια ονόματα επιτρέπονται, αλλά υπάρχει μια διεθνής παράδοση για τη χρήση μεταβλητών ονόματων στα αγγλικά. Ακόμα κι αν γράφουμε ένα μικρό script, μπορεί να έχει μεγάλη διάρκεια ζωής. Άνθρωποι από άλλες χώρες μπορεί να χρειαστεί να το διαβάσουν κάποια στιγμή.
=======
Technically, there is no error here. Such names are allowed, but there is an international convention to use English in variable names. Even if we're writing a small script, it may have a long life ahead. People from other countries may need to read it sometime.
````
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

````warn header="Reserved names"
Υπάρχει μια [λίστα δεσμευμένων λέξεων](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords), τα οποία δεν μπορούν να χρησιμοποιηθούν ως ονόματα μεταβλητών επειδή χρησιμοποιούνται από την ίδια τη γλώσσα.
Expand Down Expand Up @@ -289,16 +308,24 @@ const myBirthday = '18.04.1982';
myBirthday = '01.01.2001'; // σφάλμα, δεν ξανα αναθέτουμε!
```

<<<<<<< HEAD
Όταν ένας προγραμματιστής είναι σίγουρος ότι μια μεταβλητή δεν θα αλλάξει ποτέ, μπορούν να την δηλώσουν με την `const` για να σιγουρευτούν και να κοινοποιήσουν το γεγονός σε όλους.

<<<<<<< HEAD
=======
When a programmer is sure that a variable will never change, they can declare it with `const` to guarantee and communicate that fact to everyone.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

### Σταθερές μεταβλητές με κεφαλαία
=======
### Uppercase constants
>>>>>>> 30a5d5e2a7c3504c9afd5028f83f4a696e60aede

<<<<<<< HEAD
Υπάρχει μια ευρέως διαδεδομένη πρακτική να χρησιμοποιείτε σταθερές ως ψευδώνυμα για τιμές που είναι δύσκολα στη απομνημονευση πριν από την εκτέλεση.
=======
There is a widespread practice to use constants as aliases for difficult-to-remember values that are known before execution.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

Αυτές τις μεταβλητές τις δηλώσουμε με κεφαλαία γράμματα και κάτω παύλες.

Expand All @@ -323,7 +350,11 @@ alert(color); // #FF7F00

Πότε πρέπει να χρησιμοποιούμε κεφαλαία για μια σταθερά και πότε πρέπει να το ονομάσουμε κανονικά; Ας το ξεκαθαρίσουμε.

<<<<<<< HEAD
Το να είσαι `constant` σημαίνει απλώς ότι η τιμή μιας μεταβλητής δεν αλλάζει ποτέ. Υπάρχουν όμως σταθερές που είναι γνωστές πριν από την εκτέλεση (όπως μια δεκαεξαδική τιμή για το κόκκινο) και υπάρχουν σταθερές που * υπολογίζονται * στο χρόνο εκτέλεσης, κατά τη διάρκεια της εκτέλεσης, αλλά δεν αλλάζουν μετά την αρχική τους ανάθεση.
=======
Being a "constant" just means that a variable's value never changes. But some constants are known before execution (like a hexadecimal value for red) and some constants are *calculated* in run-time, during the execution, but do not change after their initial assignment.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

<<<<<<< HEAD
Για παραδείγμα:
Expand All @@ -335,7 +366,11 @@ For instance:
const pageLoadTime = /* ο χρόνος που χρειάζεται για να φορτώση η σέλιδα */;
```

<<<<<<< HEAD
Η τιμή του "pageLoadTime" δεν είναι γνωστή πριν από τη φόρτωση της σελίδας, επομένως έχει κανονική ονομασία. Αλλά εξακολουθεί να είναι σταθερή επειδή δεν αλλάζει μετά την ανάθεση.
=======
The value of `pageLoadTime` is not known before the page load, so it's named normally. But it's still a constant because it doesn't change after the assignment.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

<<<<<<< HEAD
Με άλλα λόγια, οι σταθερές με κεφαλαία ονομασία χρησιμοποιούνται μόνο ως ψευδώνυμα για "hard-coded" τιμές.
Expand All @@ -349,18 +384,31 @@ In other words, capital-named constants are only used as aliases for "hard-coded

Ένα όνομα μεταβλητής πρέπει να έχει καθαρό, με προφανές νόημα, που περιγράφει τα δεδομένα που αποθηκεύει.

<<<<<<< HEAD
Η ονομασία μεταβλητών είναι μια από τις πιο σημαντικές και πολύπλοκες δεξιότητες στον προγραμματισμό. Μια γρήγορη ματιά στην ονομασία μεταβλητών μπορεί να αποκαλύψει ποιος κωδικός γράφτηκε από έναν αρχάριο έναντι ενός έμπειρου προγραμματιστή.

Σε ένα πραγματικό έργο, ο περισσότερος χρόνος αφιερώνεται τροποποιώντας και επεκτείνοντας μια υπάρχουσα βάση κώδικα και όχι γράφοντας κάτι εντελώς ξεχωριστό από το μηδέν. Όταν επιστρέψουμε σε κάποιον κώδικα αφού κάνουμε κάτι άλλο για λίγο, είναι πολύ πιο εύκολο να βρείτε πληροφορίες που έχουν καλή σήμανση. Ή, με άλλα λόγια, όταν οι μεταβλητές έχουν σωστή ονομασία.
=======
Variable naming is one of the most important and complex skills in programming. A glance at variable names can reveal which code was written by a beginner versus an experienced developer.

In a real project, most of the time is spent modifying and extending an existing code base rather than writing something completely separate from scratch. When we return to some code after doing something else for a while, it's much easier to find information that is well-labelled. Or, in other words, when the variables have good names.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

Αφιερώστε χρόνο για να σκεφτείτε το σωστό όνομα για μια μεταβλητή προτού την δηλώσετε. Κάτι τέτοιο θα σας αποζημιώσει πολύ.

Μερικοί κανόνες που πρέπει να ακολουθήσετε είναι:

<<<<<<< HEAD
- Χρησιμοποιήστε ευκολά αναγνώσιμα ονόματα, όπως `userName` ή `shoppingCart`.
- Μείνετε μακριά από συντομογραφίες ή σύντομα ονόματα όπως "a`," b "," c`, εκτός εάν γνωρίζετε πραγματικά τι κάνετε.
- Κάντε ονόματα με μέγιστο περιγραφικό και συνοπτικό τρόπο. Παραδείγματα κακών ονομάτων είναι `δεδομένα` και `τιμή`. Τέτοια ονόματα δεν λένε τίποτα. Είναι να τα χρησιμοποιείτε σωστά, μόνο εάν το περιεχόμενο του κώδικα το καθιστά εξαιρετικά προφανές σε ποια δεδομένα ή αξία αναφέρεται η μεταβλητή.
- Συμφωνείτε με όρους εντός της ομάδας σας και στο μυαλό σας. Εάν ένας επισκέπτης ιστότοπου ονομάζεται "χρήστης", θα πρέπει να ονομάσουμε σχετικές μεταβλητές "currentUser" ή "newUser" αντί για "currentVisitor" ή "newManInTown".
=======
- Use human-readable names like `userName` or `shoppingCart`.
- Stay away from abbreviations or short names like `a`, `b`, and `c`, unless you know what you're doing.
- Make names maximally descriptive and concise. Examples of bad names are `data` and `value`. Such names say nothing. It's only okay to use them if the context of the code makes it exceptionally obvious which data or value the variable is referencing.
- Agree on terms within your team and in your mind. If a site visitor is called a "user" then we should name related variables `currentUser` or `newUser` instead of `currentVisitor` or `newManInTown`.
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

Ακούγεται απλό; Πράγματι είναι, αλλά η δημιουργία περιγραφικών και συνοπτικών ονομασίων μεταβλητών στην πράξη δεν είναι. Κάντε το.

Expand Down
6 changes: 6 additions & 0 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@ n = 12.345;
const bigInt = 1234567890123456789012345678901234567890n;
```

<<<<<<< HEAD
```smart header="Compatability issues"
Αυτήν τη στιγμή το "BigInt" υποστηρίζεται στον Firefox και το Chrome, αλλά όχι στο Safari/IE/Edge.

Καθώς οι αριθμοί `BigInt` σπάνια χρειάζονται, δεν τους καλύπτουμε εδώ, αλλά τους αφιερώσαμε ένα ξεχωριστό κεφάλαιο <info:bigint>. Διαβάστε το όταν χρειάζεστε τόσο μεγάλους αριθμούς.

## Συμβολοσειρά
=======
As `BigInt` numbers are rarely needed, we don't cover them here, but devoted them a separate chapter <info:bigint>. Read it when you need such big numbers.

## String
>>>>>>> b258d7d5b635c88228f7556e14fbe5e5ca7f736d

Μια συμβολοσειρά σε JavaScript πρέπει να περιβάλλεται από εισαγωγικά.

Expand Down
5 changes: 2 additions & 3 deletions 1-js/03-code-quality/06-polyfills/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Teams behind JavaScript engines have their own ideas about what to implement fir

So it's quite common for an engine to implement only part of the standard.

A good page to see the current state of support for language features is <https://kangax.github.io/compat-table/es6/> (it's big, we have a lot to study yet).
A good page to see the current state of support for language features is <https://compat-table.github.io/compat-table/es6/> (it's big, we have a lot to study yet).

As programmers, we'd like to use most recent features. The more good stuff - the better!

Expand Down Expand Up @@ -73,7 +73,6 @@ JavaScript is a highly dynamic language. Scripts may add/modify any function, ev

Two interesting polyfill libraries are:
- [core js](https://github.com/zloirock/core-js) that supports a lot, allows to include only needed features.
- [polyfill.io](https://polyfill.io/) service that provides a script with polyfills, depending on the features and user's browser.


## Summary
Expand All @@ -85,7 +84,7 @@ Just don't forget to use a transpiler (if using modern syntax or operators) and
For example, later when you're familiar with JavaScript, you can setup a code build system based on [webpack](https://webpack.js.org/) with the [babel-loader](https://github.com/babel/babel-loader) plugin.

Good resources that show the current state of support for various features:
- <https://kangax.github.io/compat-table/es6/> - for pure JavaScript.
- <https://compat-table.github.io/compat-table/es6/> - for pure JavaScript.
- <https://caniuse.com/> - for browser-related functions.

P.S. Google Chrome is usually the most up-to-date with language features, try it if a tutorial demo fails. Most tutorial demos work with any modern browser though.
Expand Down
8 changes: 4 additions & 4 deletions 1-js/04-object-basics/04-object-methods/8-chain-calls/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ importance: 2

# Chaining

There's a `ladder` object that allows to go up and down:
There's a `ladder` object that allows you to go up and down:

```js
let ladder = {
Expand All @@ -21,7 +21,7 @@ let ladder = {
};
```

Now, if we need to make several calls in sequence, can do it like this:
Now, if we need to make several calls in sequence, we can do it like this:

```js
ladder.up();
Expand All @@ -32,10 +32,10 @@ ladder.down();
ladder.showStep(); // 0
```

Modify the code of `up`, `down` and `showStep` to make the calls chainable, like this:
Modify the code of `up`, `down`, and `showStep` to make the calls chainable, like this:

```js
ladder.up().up().down().showStep().down().showStep(); // shows 1 then 0
```

Such approach is widely used across JavaScript libraries.
Such an approach is widely used across JavaScript libraries.
2 changes: 1 addition & 1 deletion 1-js/04-object-basics/09-object-toprimitive/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ let obj = {
}
};

alert(obj + 2); // 22 ("2" + 2), conversion to primitive returned a string => concatenation
alert(obj + 2); // "22" ("2" + 2), conversion to primitive returned a string => concatenation
```

## Summary
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy