microsoft / microsoft/TypeScript-Website

Document class constructor property parameters initialization order.

Open
#3,030 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.6k
Forks
1.5k
Avg merge
2d 2h
Merged PRs (30d)
7

Description

The current handbook describes very well the order of initialization for base class vs derived class. But I failed to find any documentation on when are contructor property parameters initialized. I believe they are initialized before class field initializers. This was critical info that I lacked and had to dig deeper to find it.

Please add this information to the paragraph that describes constructor property parameters. https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the handbook's Classes page at the linked Parameter Properties section and read the surrounding paragraph. Add the missing explanation of when constructor parameter properties are initialized relative to class field initializers, then confirm the section clearly describes the initialization order.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.