diff --git a/1-js/02-first-steps/08-operators/1-increment-order/solution.md b/1-js/02-first-steps/08-operators/1-increment-order/solution.md index 8a44d798e..a9a8bb1fe 100644 --- a/1-js/02-first-steps/08-operators/1-increment-order/solution.md +++ b/1-js/02-first-steps/08-operators/1-increment-order/solution.md @@ -1,5 +1,5 @@ -The answer is: +Η απάντηση είναι: - `a = 2` - `b = 2` diff --git a/1-js/02-first-steps/08-operators/1-increment-order/task.md b/1-js/02-first-steps/08-operators/1-increment-order/task.md index 7db092389..fe7ee81dc 100644 --- a/1-js/02-first-steps/08-operators/1-increment-order/task.md +++ b/1-js/02-first-steps/08-operators/1-increment-order/task.md @@ -2,9 +2,9 @@ importance: 5 --- -# The postfix and prefix forms +# Οί μορφές postfix και prefix -What are the final values of all variables `a`, `b`, `c` and `d` after the code below? +Ποιες είναι οι τελικές τιμές όλων των μεταβλητών μετά τον ακόλουθο κωδικό `a`, `b`, `c` and `d` ? ```js let a = 1, b = 1; diff --git a/1-js/02-first-steps/08-operators/2-assignment-result/solution.md b/1-js/02-first-steps/08-operators/2-assignment-result/solution.md index e3113b4cd..9e7599deb 100644 --- a/1-js/02-first-steps/08-operators/2-assignment-result/solution.md +++ b/1-js/02-first-steps/08-operators/2-assignment-result/solution.md @@ -1,4 +1,4 @@ -The answer is: +Η απάντηση είναι: - `a = 4` (multiplied by 2) - `x = 5` (calculated as 1 + 4) diff --git a/1-js/02-first-steps/08-operators/2-assignment-result/task.md b/1-js/02-first-steps/08-operators/2-assignment-result/task.md index 5345c9485..25a05a7d7 100644 --- a/1-js/02-first-steps/08-operators/2-assignment-result/task.md +++ b/1-js/02-first-steps/08-operators/2-assignment-result/task.md @@ -2,9 +2,9 @@ importance: 3 --- -# Assignment result +# Αποτέλεσμα ανάθεσης -What are the values of `a` and `x` after the code below? +Ποιες είναι οι τιμές των `a` και `x` μετά τον παρακάτω κωδικό? ```js let a = 2; diff --git a/1-js/02-first-steps/08-operators/3-primitive-conversions-questions/solution.md b/1-js/02-first-steps/08-operators/3-primitive-conversions-questions/solution.md index 924926e04..6d659f0a0 100644 --- a/1-js/02-first-steps/08-operators/3-primitive-conversions-questions/solution.md +++ b/1-js/02-first-steps/08-operators/3-primitive-conversions-questions/solution.md @@ -16,19 +16,10 @@ undefined + 1 = NaN // (6) " \t \n" - 2 = -2 // (7) ``` -<<<<<<< HEAD 1. Η πρόσθεση με μια συμβολοσειρά όπως π.χ. `"" + 1`, μετατρέπει το `1` σε μια συμβολοσειρά: `"" + 1 = "1"`, και τότε έχουμε `"1" + 0`, όπου ο ίδιος κανόνας εφαρμόζεται. 2. Η αφαίρεση `-` (όπως στις περισσότερες Μαθηματικές πράξεις) λειτουργεί μόνο με αριθμούς, και μετατρέπει μια άδεια συμβολοσειρά `""` σε `0`. 3. Η πρόσθεση με μια συμβολοσειρά, τοποθετεί τον αριθμό `5` στη συμβολοσειρά (επιπλέον παράδειγμα: `5 +"9" = "59"`). 4. Η αφαίρεση μετατρέπει τις τιμές πάντα σε αριθμούς, επομένως εδώ μετατρέπει το `" -9 "` στον αριθμό `-9` (αγνοώντας τα κενά γύρω του). 5. Η `null` γίνεται `0` μετά την αριθμητική μετατροπή. 6. Η `undefined` γίνεται `NaN` μετά την αριθμητική μετατροπή. -======= -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. -2. The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""` to `0`. -3. The addition with a string appends the number `5` to the string. -4. The subtraction always converts to numbers, so it makes `" -9 "` a number `-9` (ignoring spaces around it). -5. `null` becomes `0` after the numeric conversion. -6. `undefined` becomes `NaN` after the numeric conversion. -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`. ->>>>>>> a0bfa924a17cad8e7fee213904b27dbf57c2dbac + diff --git a/1-js/02-first-steps/08-operators/4-fix-prompt/task.md b/1-js/02-first-steps/08-operators/4-fix-prompt/task.md index b3ea4a3a3..7d6427638 100644 --- a/1-js/02-first-steps/08-operators/4-fix-prompt/task.md +++ b/1-js/02-first-steps/08-operators/4-fix-prompt/task.md @@ -2,13 +2,13 @@ importance: 5 --- -# Fix the addition +# Διόρθωση της προσθήσης -Here's a code that asks the user for two numbers and shows their sum. +Εδώ υπάρχει ένας κώδικας που ζητά από το χρήστη δύο αριθμούς και δείχνει το άθροισμά τους. -It works incorrectly. The output in the example below is `12` (for default prompt values). +Λειτουργεί εσφαλμένα. Η έξοδος στο παρακάτω παράδειγμα είναι `12` (για προκαθορισμένες άμεσες τιμές). -Why? Fix it. The result should be `3`. +Ποιός είναι ο λόγος; Φτιάξτε το. Το αποτέλεσμα θα πρέπει να είναι `3`. ```js run let a = prompt("First number?", 1); diff --git a/1-js/02-first-steps/08-operators/article.md b/1-js/02-first-steps/08-operators/article.md index 9d1561ef4..404ed81ed 100644 --- a/1-js/02-first-steps/08-operators/article.md +++ b/1-js/02-first-steps/08-operators/article.md @@ -2,7 +2,7 @@ Γνωρίζουμε πολλούς τελεστές από το σχολείο. Είναι πράγματα όπως η πρόσθεση `+`, ο πολλαπλασιασμός `*`, η αφαίρεση `-` και ούτω καθεξής. -Σε αυτό το κεφάλαιο, θα ξεκινήσουμε με απλούς τελεστές και, στη συνέχεια, θα επικεντρωθούμε σε συγκεκριμένες πτυχές της JavaScript, που δεν καλύπτονται από στη σχολική αριθμητική. +Σε αυτό το κεφάλαιο, θα ξεκινήσουμε με απλούς τελεστές και, στη συνέχεια, θα επικεντρωθούμε σε συγκεκριμένες πτυχές της JavaScript, που δεν καλύπτονται από στη σχολική αριθμητική. ## Όροι: "unary", "binary", "operand" diff --git a/1-js/02-first-steps/10-ifelse/2-check-standard/task.md b/1-js/02-first-steps/10-ifelse/2-check-standard/task.md index 11820c7a9..ab96ebd1b 100644 --- a/1-js/02-first-steps/10-ifelse/2-check-standard/task.md +++ b/1-js/02-first-steps/10-ifelse/2-check-standard/task.md @@ -9,7 +9,6 @@ Using the `if..else` construct, write the code which asks: 'What is the "officia Εάν ο επισκέπτης εισέλθει στο "ECMAScript", τότε εξάγετε "Right!", Διαφορετικά - εξάγετε: "Didn't know? ECMAScript!" - ![](ifelse_task2.svg) [demo src="ifelse_task2"] diff --git a/1-js/02-first-steps/10-ifelse/article.md b/1-js/02-first-steps/10-ifelse/article.md index 1e5b251af..d97200aa6 100644 --- a/1-js/02-first-steps/10-ifelse/article.md +++ b/1-js/02-first-steps/10-ifelse/article.md @@ -6,7 +6,7 @@ ## Η δήλωση "if" -Η δήλωση `if(...)` αξιολογεί μια συνθήκη σε παρένθεση και, εάν το αποτέλεσμα είναι `true`, εκτελεί ένα μπλοκ κώδικα. +Η δήλωση `if(...)` αξιολογεί μια συνθήκη σε παρένθεση και, εάν το αποτέλεσμα είναι `true`, εκτελεί ένα μπλοκ κώδικα. Για παράδειγμα: diff --git a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md index 9ea6a8c68..48afe290b 100644 --- a/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md +++ b/1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md @@ -4,10 +4,6 @@ importance: 3 # Ελέγξτε εκτος του εύρος -<<<<<<< HEAD Γράψτε μια συνθήκη `if` για να ελέγξετε ότι η `age` ΔΕΝ είναι μεταξύ 14 και 90. -======= -Write an `if` condition to check that `age` is NOT between `14` and `90` inclusively. ->>>>>>> 181cc781ab6c55fe8c43887a0c060db7f93fb0ca Δημιουργήστε δύο παραλλαγές: η πρώτη χρησιμοποιώντας NOT `!`, Η δεύτερη - χωρίς αυτήν. diff --git a/1-js/02-first-steps/13-while-for/2-which-value-while/solution.md b/1-js/02-first-steps/13-while-for/2-which-value-while/solution.md index 61153e5e1..137eb11ff 100644 --- a/1-js/02-first-steps/13-while-for/2-which-value-while/solution.md +++ b/1-js/02-first-steps/13-while-for/2-which-value-while/solution.md @@ -20,12 +20,12 @@ while (i++ < 5) alert( i ); ``` - Η πρώτη τιμή είναι πάλι `i = 1. Η φόρμα postfix του `i++` αυξάνει το `i` και στη συνέχεια επιστρέφει την *παλία* τιμή, οπότε η σύγκριση `i++ < 5` θα χρησιμοποιεί το `i = 0` (αντίθετα με το `++i < 5`) + Η πρώτη τιμή είναι πάλι `i = 1. Η φόρμα postfix του `i++` αυξάνει το `i` και στη συνέχεια επιστρέφει την *παλία* τιμή, οπότε η σύγκριση `i++ < 5` θα χρησιμοποιεί το `i = 0` (αντίθετα με το `++i < 5`) - Αλλά η κλήση `alert` είναι ξεχωριστή. Είναι μια άλλη δήλωση που εκτελείται μετά την αύξηση και τη σύγκριση. Έτσι παίρνει το τρέχον `i = 1`. - - Στη συνέχεια, ακολουθούν τα `2, 3, 4…`. + Αλλά η κλήση `alert` είναι ξεχωριστή. Είναι μια άλλη δήλωση που εκτελείται μετά την αύξηση και τη σύγκριση. Έτσι παίρνει το τρέχον `i = 1`. - Ας σταματήσουμε στο `i = 4`. Η φόρμα prefix `++i` θα την αυξήσει και θα χρησιμοποιήσει το `5` στη σύγκριση. Αλλά εδώ έχουμε τη φόρμα postfix `i++`. Έτσι αυξάνει το `i στο 5`, αλλά επιστρέφει την παλιά τιμή. Ως εκ τούτου, η σύγκριση είναι στην πραγματικότητα `while(4 < 5)` -- true, και ο έλεγχος συνεχίζεται στο "alert". + Στη συνέχεια, ακολουθούν τα `2, 3, 4…`. - Η τιμή `i = 5` είναι η τελευταία, επειδή στο επόμενο βήμα `while(5 < 5)` είναι false. + Ας σταματήσουμε στο `i = 4`. Η φόρμα prefix `++i` θα την αυξήσει και θα χρησιμοποιήσει το `5` στη σύγκριση. Αλλά εδώ έχουμε τη φόρμα postfix `i++`. Έτσι αυξάνει το `i στο 5`, αλλά επιστρέφει την παλιά τιμή. Ως εκ τούτου, η σύγκριση είναι στην πραγματικότητα `while(4 < 5)` -- true, και ο έλεγχος συνεχίζεται στο "alert". + + Η τιμή `i = 5` είναι η τελευταία, επειδή στο επόμενο βήμα `while(5 < 5)` είναι false. diff --git a/1-js/02-first-steps/15-function-basics/1-if-else-required/task.md b/1-js/02-first-steps/15-function-basics/1-if-else-required/task.md index 4f69a5c8c..3823bd40b 100644 --- a/1-js/02-first-steps/15-function-basics/1-if-else-required/task.md +++ b/1-js/02-first-steps/15-function-basics/1-if-else-required/task.md @@ -2,11 +2,11 @@ importance: 4 --- -# Is "else" required? +# Απαιτείται "else"? -The following function returns `true` if the parameter `age` is greater than `18`. +Η ακόλουθη συνάρτηση επιστρέφει `true` αν η παράμετρος `age` είναι μεγαλύτερη από '18'. -Otherwise it asks for a confirmation and returns its result: +Διαφορετικά ζητά επιβεβαίωση και επιστρέφει το αποτέλεσμα: ```js function checkAge(age) { @@ -21,7 +21,7 @@ function checkAge(age) { } ``` -Will the function work differently if `else` is removed? +Η συνάρτηση θα λειτουργήσει διαφορετικά αν αφαιρεθεί το `else`; ```js function checkAge(age) { @@ -34,5 +34,5 @@ function checkAge(age) { */!* } ``` +Υπάρχει διαφορά στη συμπεριφορά αυτών των δύο παραλλαγών; -Is there any difference in the behavior of these two variants? diff --git a/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/solution.md b/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/solution.md index e48502642..fce7d2cc5 100644 --- a/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/solution.md +++ b/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/solution.md @@ -1,4 +1,4 @@ -Using a question mark operator `'?'`: +Χρήση ερωτηματικού χειριστή `'?'`: ```js function checkAge(age) { @@ -6,7 +6,7 @@ function checkAge(age) { } ``` -Using OR `||` (the shortest variant): +Χρήση OR `||` (η συντομότερη παραλλαγή): ```js function checkAge(age) { @@ -14,4 +14,5 @@ function checkAge(age) { } ``` -Note that the parentheses around `age > 18` are not required here. They exist for better readability. +Σημειώστε ότι οι παρενθέσεις γύρω από την `age > 18` δεν απαιτούνται εδώ. Υπάρχουν για καλύτερη αναγνωσιμότητα. + diff --git a/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md b/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md index 46da079c0..23e4339fa 100644 --- a/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md +++ b/1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/task.md @@ -2,11 +2,11 @@ importance: 4 --- -# Rewrite the function using '?' or '||' +# Επαναγραφή της συνάρτησης '?' ή '||' -The following function returns `true` if the parameter `age` is greater than `18`. +Η ακόλουθη συνάρτηση επιστρέφει `true` αν η παράμετρος `age` είναι μεγαλύτερη από '18'. -Otherwise it asks for a confirmation and returns its result. +Διαφορετικά ζητά επιβεβαίωση και επιστρέφει το αποτέλεσμα. ```js function checkAge(age) { @@ -18,9 +18,9 @@ function checkAge(age) { } ``` -Rewrite it, to perform the same, but without `if`, in a single line. +Ξαναγράψτε το, για να εκτελέσετε το ίδιο, αλλά χωρίς το `if`, σε μία μόνο γραμμή. -Make two variants of `checkAge`: +Κάντε δύο παραλλαγές του `checkAge`: -1. Using a question mark operator `?` -2. Using OR `||` +1. Χρήση ερωτηματικού τελεστή `?` +2. Χρήση OR `||` diff --git a/1-js/02-first-steps/15-function-basics/3-min/solution.md b/1-js/02-first-steps/15-function-basics/3-min/solution.md index 2236d9203..95817e6c9 100644 --- a/1-js/02-first-steps/15-function-basics/3-min/solution.md +++ b/1-js/02-first-steps/15-function-basics/3-min/solution.md @@ -1,4 +1,4 @@ -A solution using `if`: +Λύση με χρήση `if`: ```js function min(a, b) { @@ -10,7 +10,7 @@ function min(a, b) { } ``` -A solution with a question mark operator `'?'`: +Λύση με τελεστή ερωτηματικού σήματος `'?'`: ```js function min(a, b) { @@ -18,4 +18,4 @@ function min(a, b) { } ``` -P.S. In the case of an equality `a == b` it does not matter what to return. \ No newline at end of file +Υ.Γ. Στην περίπτωση μιας ισότητας 'a = = b' δεν έχει σημασία τι να επιστρέψει. \ No newline at end of file diff --git a/1-js/02-first-steps/15-function-basics/3-min/task.md b/1-js/02-first-steps/15-function-basics/3-min/task.md index 50edd0d36..9d6b2542f 100644 --- a/1-js/02-first-steps/15-function-basics/3-min/task.md +++ b/1-js/02-first-steps/15-function-basics/3-min/task.md @@ -2,11 +2,11 @@ importance: 1 --- -# Function min(a, b) +# Συνάρτηση min(a, b) -Write a function `min(a,b)` which returns the least of two numbers `a` and `b`. +Γράψτε μια συνάρτηση 'min (a, b)' η οποία επιστρέφει το ελάχιστο των δύο αριθμών 'a' και 'b'. -For instance: +Παραδείγματος χάριν: ```js min(2, 5) == 2 diff --git a/1-js/02-first-steps/15-function-basics/4-pow/task.md b/1-js/02-first-steps/15-function-basics/4-pow/task.md index f569320c7..81cf3a86d 100644 --- a/1-js/02-first-steps/15-function-basics/4-pow/task.md +++ b/1-js/02-first-steps/15-function-basics/4-pow/task.md @@ -4,16 +4,15 @@ importance: 4 # Function pow(x,n) -Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, multiplies `x` by itself `n` times and returns the result. +Γράψτε μια συνάρτηση 'pow (x, n)' που επιστρέφει 'x' στην ισχύ 'n'. Ή, με άλλα λόγια, πολλαπλασιάζει το `x` με τον εαυτό του `n` φορές και επιστρέφει το αποτέλεσμα. ```js pow(3, 2) = 3 * 3 = 9 pow(3, 3) = 3 * 3 * 3 = 27 pow(1, 100) = 1 * 1 * ...* 1 = 1 ``` - -Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`. +Δημιουργήστε μια ιστοσελίδα που υποκινεί για 'x' και 'n', και στη συνέχεια εμφανίζει το αποτέλεσμα του 'pow (x, n)'. [demo] -P.S. In this task the function should support only natural values of `n`: integers up from `1`. +Υ.Σ. Σε αυτή την εργασία η συνάρτηση θα πρέπει να υποστηρίζει μόνο φυσικές τιμές του 'n': ακέραιοος από το '1'. \ No newline at end of file