Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
[guide] remove trailing or leading underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
vsemozhetbyt authored and ljharb committed Jan 18, 2017
1 parent 2313174 commit 6e4859d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1022,13 +1022,13 @@ Other Style Guides
}
inherits(PeekableQueue, Queue);
PeekableQueue.prototype.peek = function () {
return this._queue[0];
return this.queue[0];
};

// good
class PeekableQueue extends Queue {
peek() {
return this._queue[0];
return this.queue[0];
}
}
```
Expand Down Expand Up @@ -1971,7 +1971,7 @@ Other Style Guides
function getType() {
console.log('fetching type...');
// set the default type to 'no type'
const type = this._type || 'no type';
const type = this.type || 'no type';
return type;
}
Expand All @@ -1981,15 +1981,15 @@ Other Style Guides
console.log('fetching type...');
// set the default type to 'no type'
const type = this._type || 'no type';
const type = this.type || 'no type';
return type;
}
// also good
function getType() {
// set the default type to 'no type'
const type = this._type || 'no type';
const type = this.type || 'no type';
return type;
}
Expand Down

0 comments on commit 6e4859d

Please sign in to comment.