Skip to content
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

Constructor, operator "new" #192

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

behrends
Copy link
Contributor

No description provided.

@javascript-translate-bot javascript-translate-bot added the review needed Review needed, please approve or request changes label Nov 28, 2023
@javascript-translate-bot

Error: the article has another translator @dride-for-sure in the Progress Issue #1.

Copy link
Contributor

@J-Cake J-Cake left a comment

Choose a reason for hiding this comment

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

Sehr gut

Comment on lines 17 to 18
accumulator.read(); // fügt den vom Benutzer eingegebenen Wert hinzu
accumulator.read(); // fügt den vom Benutzer eingegebenen Wert hinzu
Copy link
Contributor

Choose a reason for hiding this comment

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

Fügt ... hinzu => Addiert


Let's note once again -- technically, any function (except arrow functions, as they don't have `this`) can be used as a constructor. It can be run with `new`, and it will execute the algorithm above. The "capital letter first" is a common agreement, to make it clear that a function is to be run with `new`.
Lassen Sie uns noch einmal festhalten - technisch gesehen kann jede Funktion (außer Pfeilfunktionen, da sie kein `this` haben) als Konstruktor verwendet werden. Sie kann mit `new` ausgeführt werden und wird das oben beschriebene Verfahren durchführen. „Beginnt mit Großbuchstaben“ ist eine allgemeine Vereinbarung, um klarzustellen, dass eine Funktion mit `new` ausgeführt werden soll.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nochmal konsistenz - inzwischen ist die Du form häufiger


Usually, constructors do not have a `return` statement. Their task is to write all necessary stuff into `this`, and it automatically becomes the result.
Normalerweise haben Konstruktoren keine `return`-Anweisung. Ihre Aufgabe ist es, alles Notwendige in `this` zu schreiben, und das wird automatisch zum Ergebnis.
Copy link
Contributor

Choose a reason for hiding this comment

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

Du / Sie form

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hier ist „Ihre“ keine Anrede sondern in der 3. Person, bezieht sich also auf Konstruktoren.

@javascript-translate-bot javascript-translate-bot removed the review needed Review needed, please approve or request changes label Dec 14, 2023
@javascript-translate-bot

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

@javascript-translate-bot javascript-translate-bot added the changes requested Waiting for changes and /done from PR author label Dec 14, 2023
@J-Cake
Copy link
Contributor

J-Cake commented Dec 14, 2023

Entschuldige für die Verszögerung. Bin zur Zeit mit vielem überfordert 😅

@behrends
Copy link
Contributor Author

Kein Problem 👍 gewünschte Änderungen umgesetzt

@J-Cake J-Cake merged commit 3421d40 into javascript-tutorial:master Dec 15, 2023
1 check passed
@javascript-translate-bot

Error: the article has another translator @dride-for-sure, not @behrends in the Progress Issue #1. Please update the progress issue or ask maintainers to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes requested Waiting for changes and /done from PR author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants