mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 05:58:04 -05:00
[guide] remove trailing or leading underscores
This commit is contained in:
committed by
Jordan Harband
parent
231317408f
commit
6e4859d7c6
10
README.md
10
README.md
@@ -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];
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -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;
|
||||
}
|
||||
@@ -1981,7 +1981,7 @@ 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;
|
||||
}
|
||||
@@ -1989,7 +1989,7 @@ Other Style Guides
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user