Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Docs: usage of parameter properties as class members in constructor

Open
#3,041 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
documentation

Research direction

Start with the Parameter Properties section in the TypeScript Handbook linked in the issue, and review how the constructor example is currently explained. Clarify when the parameter property is available as a class member and address whether this.name or the parameter name is preferable. Done means the documentation answers this question with an accurate example.

Written by the indexing model from the issue text.

Description

The docs don't seem to specify from what point onwards (after constructor signature or after constructor execution) parameter properties are available as class members - and hence don't seem to make any indication which of the following is "better":

constructor(private name: string) {
  console.log(this.name);
  console.log(name);
}
Dominant language
TypeScript
Stars
2.6k
Forks
1.5k
Avg merge
1d 12h
Merged PRs (30d)
5

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.

More from microsoft/TypeScript-Website

All issues in microsoft/TypeScript-Website

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.