You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/rules/new-cap.md
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ rule_type: suggestion
7
7
The `new` operator in JavaScript creates a new instance of a particular type of object. That type of object is represented by a constructor function. Since constructor functions are just regular functions, the only defining characteristic is that `new` is being used as part of the call. Native JavaScript functions begin with an uppercase letter to distinguish those functions that are to be used as constructors from functions that are not. Many style guides recommend following this pattern to more easily determine which functions are to be used as constructors.
8
8
9
9
```js
10
-
var friend =newPerson();
10
+
constfriend=newPerson();
11
11
```
12
12
13
13
## Rule Details
@@ -64,7 +64,7 @@ Examples of **incorrect** code for this rule with the default `{ "newIsCap": tru
0 commit comments