File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
javascript/ql/src/Declarations Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 44<qhelp >
55<overview >
66<p >
7- In TypeScript the keywords <code >constructor</code > and <code >new</code > for member declarations are
8- used to declare constructors in classes and interfaces respectively.
9- However, by using the wrong keyword a programmer can accidentally declare e.g.
10- a method called <code >constructor</code > inside an interface.
11- Similarly the keyword <code >function</code > is used to declare functions in
12- some contexts, however, using the keyword <code >function</code > inside a class
13- or interface results in declaring a method called <code >function</code >.
7+ In TypeScript the keywords <code >constructor</code > and <code >new</code > for
8+ member declarations are used to declare constructors in classes and interfaces
9+ respectively.
10+ However, a member declaration with the name <code >new</code > in an interface
11+ or <code >constructor</code > in a class, will declare ordinary methods named
12+ <code >new</code > or <code >constructor</code > rather than constructors.
13+ Similarly, the keyword <code >function</code > is used to declare functions in
14+ some contexts, however, using the name <code >function</code > for a class
15+ or interface member declaration declares a method named <code >function</code >.
1416</p >
1517
1618</overview >
You can’t perform that action at this time.
0 commit comments