Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Function expressions#93

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
kplich wants to merge2 commits intojavascript-tutorial:masterfromkplich:master
Closed

Function expressions#93

kplich wants to merge2 commits intojavascript-tutorial:masterfromkplich:master

Conversation

kplich
Copy link

Translated the article into Polish.

@CLAassistant
Copy link

CLAassistant commentedFeb 25, 2021
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link

@Onxi95Onxi95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For future reference - please don't replace the colons with brackets, don't add extra bold, emoji, etc. This may change the context of the original text :)


In JavaScript, a function is not a "magical language structure",but a special kind of value.
W JavaScripcie, funkcje nie są "magicznymi konstrukcjami językowymi",lecz po prostu rodzajem wartości.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please replacelecz po prostu rodzajem wartości bylecz szczególnym rodzajem wartości - it shouldn't change the context of the original sentence :)

};
```

Here, the function is created and assigned to the variable explicitly, like any other value. No matter how the function is defined, it's just a value stored in the variable `sayHi`.
Funkcja jest tworzona i przypisywana do zmiennej - tak, jakby była to zwykła wartość. Nie ważne, w jaki sposób zostanie ona zdefiniowana - będzie to po prostu wartość, przechowywana w zmiennej `sayHi`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You skipped the wordexplicitly. Pleace change:Funkcja jest tworzona i przypisywana do zmiennej toFunkcja jest tworzona i jawnie przypisywana do zmiennej.


Let's look at more examples of passing functions as values and using function expressions.
Spójrzmy na kolejne przykład przekazywania funkcji jako wartości oraz wykorzystania wyrażeń funkcyjnych.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

typo! Please replaceprzykład byprzykłady - plural form :)

@@ -121,24 +121,24 @@ function ask(question, yes, no) {
*/!*

function showOk() {
alert( "You agreed." );
alert( "Może być." );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please replaceMoże być byZgoda została wyrażona. I thought aboutZgodziłeś się but then the expression does not have a female version. Any other ideas?

}

function showCancel() {
alert( "You canceled the execution." );
alert( "Nie chcesz nic wywoływać." );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Please replaceNie chcesz nic wywoływać byWykonanie zostało anulowane.

let sum = function(a, b) {
return a + b;
};
```

The more subtle difference is *when* a function is created by the JavaScript engine.
Bardziej subtelną różnicą jest różnica w *momencie tworzenia* funkcji przez silnik JavaScriptu.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pleace replaceBardziej subtelną różnicą jest różnica w *momencie tworzenia* funkcji przez silnik JavaScriptu. byBardziej subtelną różnicą jest to *kiedy* funkcja jest tworzona przez silnik JavaScriptu.


That's duetointernal algorithms. When JavaScript prepares to run the script, it first looks for global Function Declarations in it and creates the functions. We can think of it as an "initialization stage".
Wynikatoz algorytmu wykonywania skryptu. Przygotowując skrypt do wykonania, JavaScript najpierw wyszukuje w nim globalnych deklaracji funkcji, a następnie je tworzy - można nazwać to etapem "inicjalizacji".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ReplaceWynika to z algorytmu wykonywania skryptu. byWynika to z wewnętrznego algorytmu wykonywania skryptu.

@@ -294,75 +294,75 @@ if (age < 18) {
}
}

// Here we're out of curly braces,
// so we can not see Function Declarations made inside of them.
// Skończyły nam się klamerki,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

klamerki may be confusing. Pleace replace it bynawiasy klamrowe.


...But if a Function Declaration does not suit us for some reason, or we need a conditional declaration (we've just seen an example),then Function Expression should be used.
Dopiero jeśli z jakichś powodów deklaracja funkcji nie odpowiada naszym potrzebom (kiedy, jak w przykładzie, potrzebujemy warunkowej deklaracji funkcji),wtedy można rozważyć użycie wyrażenia funkcyjnego.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pleace replace
Dopiero jeśli z jakichś powodów deklaracja funkcji nie odpowiada naszym potrzebom (kiedy, jak w przykładzie, potrzebujemy warunkowej deklaracji funkcji)
by
Dopiero jeśli z jakichś powodów deklaracja funkcji nie odpowiada naszym potrzebom, albo potrzebujemy warunkowej deklaracji funkcji (jak w przykładzie powyżej)

  • I think it is more meaningful :)


...But if a Function Declaration does not suit us for some reason, or we need a conditional declaration (we've just seen an example),then Function Expression should be used.
Dopiero jeśli z jakichś powodów deklaracja funkcji nie odpowiada naszym potrzebom (kiedy, jak w przykładzie, potrzebujemy warunkowej deklaracji funkcji),wtedy można rozważyć użycie wyrażenia funkcyjnego.
```

## Summary

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ReplaceSummary byPodsumowanie :)

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@kplichkplich closed thisOct 29, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Onxi95Onxi95Onxi95 requested changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@kplich@CLAassistant@javascript-translate-bot@Onxi95

[8]ページ先頭

©2009-2025 Movatter.jp