- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 3
Functions #81
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
Merged
+280
−280
Merged
Functions #81
Changes from 3 commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
60715e9
1.2.15
otmon76 4efc42b
Update solution.md
otmon76 c38fee4
Update article.md
otmon76 ea843c2
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 37926e7
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 c088893
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 25633ea
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 deec629
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 e83cba3
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 2d86dc3
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 a7cf5df
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 96e0a34
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 6284a04
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 6c25b52
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 9dbcf54
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 0dd5146
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 7e4f888
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 52ed0ba
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 7c46b14
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 9f9e845
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 819ddbb
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 0995d74
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 0527b60
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 99f8794
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 a1313db
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 405a4b7
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 9e5a4ea
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 8999849
Update 1-js/02-first-steps/15-function-basics/2-rewrite-function-ques…
otmon76 f918572
Update 1-js/02-first-steps/15-function-basics/3-min/task.md
otmon76 223451a
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 9581c5a
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 e433ba2
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 491729c
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 007d3c4
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 3e2d6ce
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 4f2806c
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 9287618
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 393a83f
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 8d1af04
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 7dfa61f
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 b37f9d3
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 655e1fd
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 34f7134
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 4e26f73
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 e2cd6ba
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 4f9e628
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 818abcf
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 493f8ed
Update 1-js/02-first-steps/15-function-basics/article.md
otmon76 fc3cfbe
Update 1-js/02-first-steps/15-function-basics/1-if-else-required/task.md
otmon76 a040390
Update 1-js/02-first-steps/15-function-basics/1-if-else-required/solu…
otmon76 a47afda
Update 1-js/02-first-steps/15-function-basics/2-rewrite-function-ques…
otmon76 f89a3fc
Merge branch 'master' into 1.2.15
danipoma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
1-js/02-first-steps/15-function-basics/1-if-else-required/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
No difference! | ||
Žádný rozdíl není. | ||
|
||
In both cases, `return confirm('Did parents allow you?')` executes exactly when the `if` condition is falsy. | ||
V obou případech se příkaz `return confirm('Dovolili ti to rodiče?');` spustí právě tehdy, když podmínka za `if` není splněna. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
1-js/02-first-steps/15-function-basics/2-rewrite-function-question-or/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
Using a question mark operator `'?'`: | ||
Pomocí operátoru otazníku `'?'`: | ||
|
||
```js | ||
function checkAge(age) { | ||
return (age > 18) ? true : confirm('Did parents allow you?'); | ||
function ověřVěk(věk) { | ||
return (věk > 18) ? true : confirm('Dovolili ti to rodiče?'); | ||
} | ||
``` | ||
|
||
Using OR `||` (the shortest variant): | ||
Pomocí OR `||` (kratší varianta): | ||
|
||
```js | ||
function checkAge(age) { | ||
return (age > 18) || confirm('Did parents allow you?'); | ||
function ověřVěk(věk) { | ||
return (věk > 18) || confirm('Dovolili ti to rodiče?'); | ||
} | ||
``` | ||
|
||
Note that the parentheses around `age > 18` are not required here. They exist for better readability. | ||
Všimněte si, že závorky okolo `věk > 18` zde nejsou nutné. Slouží jen k lepší čitelnosti. | ||
otmon76 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
|
||
```js run demo | ||
function pow(x, n) { | ||
let result = x; | ||
function mocnina(x, n) { | ||
let výsledek = x; | ||
|
||
for (let i = 1; i < n; i++) { | ||
result *= x; | ||
výsledek *= x; | ||
} | ||
|
||
return result; | ||
return výsledek; | ||
} | ||
|
||
let x = prompt("x?", ''); | ||
let n = prompt("n?", ''); | ||
|
||
if (n < 1) { | ||
alert(`Power ${n} is not supported, use a positive integer`); | ||
alert(`${n}-tá mocnina není podporována, zadejte kladné celé číslo`); | ||
} else { | ||
alert( pow(x, n) ); | ||
alert( mocnina(x, n) ); | ||
} | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.