[guide] remove trailing or leading underscores

This commit is contained in:
Vse Mozhet Byt
2017-01-18 07:33:11 +02:00
committed by Jordan Harband
parent 231317408f
commit 6e4859d7c6

View File

@@ -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;
}