Skip to content

Object methods, "this" - #99

Merged
deivuss331 merged 26 commits into
javascript-tutorial:masterfrom
covalt1985:master
Jun 21, 2022
Merged

deivuss331 merged 26 commits into
javascript-tutorial:masterfrom
covalt1985:master

Conversation

@covalt1985

Copy link
Copy Markdown
Contributor

No description provided.

@CLAassistant

CLAassistant commented Jun 1, 2021 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

W wiΔ™kszoΕ›ci przeglΔ…darek wiadomoΕ›Δ‡ o bΕ‚Δ™dzie nie zawiera zbyt wielu szczegΓ³Ε‚Γ³w mΓ³wiΔ…cych co poszΕ‚o nie tak.

The error message in most browsers does not give us much of a clue about what went wrong.
**BΕ‚Δ…d wystΔ…piΕ‚ poniewaΕΌ nie ma Ε›rednika po`user = {...}`.**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing space between "po" and "`user..."

```

Then we can also see that such a joint expression is syntactically a call of the object `{ go: ... }` as a function with the argument `(user.go)`. And that also happens on the same line with `let user`, so the `user` object has not yet even been defined, hence the error.
Teraz widzimy, ΕΌe taka skΕ‚adnia jest w zasadzie wywoΕ‚aniem funkcji `{ go: ... }` z argumentem `(user.go)`. W dodatku wywoΕ‚anie to znajduje siΔ™ w tej samej linijce co `let user`, wiΔ™c do obiekt `user` nie zostaΕ‚ jeszcze nawet zdefiniowany, dlatego pojawia siΔ™ bΕ‚Δ…d.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The sense of the first sentence has changed a bit. It should be something like: "Teraz widzimy, ΕΌe taka skΕ‚adnia jest w zasadzie wywoΕ‚aniem objektu { go: ... } jako funkcji z argumentem...".

Also, please remove redunand "do" word from that part of the second sentence: "wiΔ™c do obiekt user nie zostaΕ‚ jeszcze..."

---

# Syntax check
# Sprawdzian ze skΕ‚adni

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be more like: "Sprawdzenie skΕ‚adni"

1. Jest to zwykΕ‚e wywoΕ‚anie metody obiektu.

2. The same, brackets do not change the order of operations here, the dot is first anyway.
2. Tak jak powyΕΌej. Nawiasy nie zmieniajΔ… tutaj kolejnoΕ›ci wykonywania dziaΕ‚aΕ„. Kropka ma pierwszeΕ„stwo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please try to avoid splitting one original sentence into some smaller ones while translating.

So please change that to: "Tak jak powyΕΌej, nawiasy nie zmieniajΔ… tutaj kolejnoΕ›ci wykonywania dziaΕ‚aΕ„, kropka i tak ma pierwszeΕ„stwo."

---

# Explain the value of "this"
# OkreΕ›l wartoΕ›Δ‡ "this":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please remove redunand ":" sign at the end of line.

WartoΕ›Δ‡ `this` jest tu ustalona wyΕ‚Δ…cznie dla tej funkcji. Bloki kodu i obiekty nie sΔ… w tym przypadku brane pod uwagΔ™.

So `ref: this` actually takes current `this` of the function.
Zatem `ref:this` jest rΓ³wnoznaczne z `this` funkcji.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please change "ref:this" into "ref: this" just for clarity.

---

# Using "this" in object literal
# "this" w literaΕ‚ach obiektowych

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

"UΕΌywanie this w obiektach" sounds better to me.

PoniΕΌsza funkcja `makeUser` zwraca obiekt.

What is the result of accessing its `ref`? Why?
Jaki bΔ™dzie rezultat dostΔ™pu do jego `ref` ? I dlaczego?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please remove space between ref and question mark

CzΔ™sto siΔ™ zdarza, ΕΌe metoda obiektu do poprawnego dziaΕ‚ania potrzebuje dostΔ™pu do informacji zawartej w tym samym obiekcie.

For instance, the code inside `user.sayHi()` may need the name of the `user`.
DLa przykładu, kod wewnątrz `user.sayHi()` może wymagać imienia użytkownika `user`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

word "DLa" should have only first letter capital

MoΕΌliwe jest rΓ³wnieΕΌ uzyskanie dostΔ™pu do obiektu bez uΕΌywania `this`, przez odwoΕ‚anie siΔ™ do niego za pomocΔ… zmiennej z zewnΔ…trz:

```js
```js run

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please remove run

@javascript-translate-bot

Copy link
Copy Markdown

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

@covalt1985

Copy link
Copy Markdown
Contributor Author

/done

@deivuss331
deivuss331 merged commit 1545116 into javascript-tutorial:master Jun 21, 2022
@javascript-translate-bot

Copy link
Copy Markdown

Thank you πŸ’– I updated the Progress Issue #1 πŸŽ‰ πŸŽ‰ πŸŽ‰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants