Perform type coercion at the beginning of the statement.
// => this.reviewScore = 9;
// bad
var totalScore = this.reviewScore + '';
// good
var totalScore = '' + this.reviewScore;
// bad
var totalScore = '' + this.reviewScore + ' total score';
// good
var totalScore = this.reviewScore + ' total score';
By their own rule, shouldn't these be bad/good/good/bad?
2
u/pimlottc Mar 27 '15
By their own rule, shouldn't these be bad/good/good/bad?