Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1044,15 +1044,15 @@
});
```

- Use a leading underscore `_` when naming private properties
- Use a leading underscore `_` when naming private properties ([When a member is private?](http://javascript.crockford.com/private.html))

```javascript
// bad
this.__firstName__ = 'Panda';
this.firstName_ = 'Panda';
var __firstName__ = 'Panda';
var firstName_ = 'Panda';

// good
this._firstName = 'Panda';
var _firstName = 'Panda';
```

- When saving a reference to `this` use `_this`.
Expand Down