return when it makes sense. fixes #9

This commit is contained in:
Harrison Shoff
2012-11-02 00:04:56 -07:00
parent 622050681b
commit 8f0ef5d9fd

View File

@@ -264,32 +264,6 @@
}
```
- Always return as early as possible
```javascript
// bad
function() {
var size;
if (!arguments.length) {
size = false;
} else {
size = arguments.length;
}
return size;
}
// good
function() {
if (!arguments.length) {
return false;
}
return arguments.length;
}
```
- Never name a parameter `arguments`, this will take precendence over the `arguments` object that is given to every function scope.
```javascript