Closed markdessain closed 8 years ago
If you find yourself doing the same bit of code in every block in the if/else statement it often means it doesn't need to be apart of the if statement in the first place.
if(...) { a = b; ... else if(...) { a = b; ... else(...) { a = b; ... }
can become:
if(...) { ... else if(...) { ... else(...) { ... } a = b;
You can see the File changed tab, as you're always changing the innerHtml no matter what the operation is.
1. Repeated statement in if block
If you find yourself doing the same bit of code in every block in the if/else statement it often means it doesn't need to be apart of the if statement in the first place.
can become:
You can see the File changed tab, as you're always changing the innerHtml no matter what the operation is.