Skip to content

Commit 8f0ef5d

Browse files
committed
return when it makes sense. fixes airbnb#9
1 parent 6220506 commit 8f0ef5d

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

README.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -264,32 +264,6 @@
264264
}
265265
```
266266
267-
- Always return as early as possible
268-
269-
```javascript
270-
// bad
271-
function() {
272-
var size;
273-
274-
if (!arguments.length) {
275-
size = false;
276-
} else {
277-
size = arguments.length;
278-
}
279-
280-
return size;
281-
}
282-
283-
// good
284-
function() {
285-
if (!arguments.length) {
286-
return false;
287-
}
288-
289-
return arguments.length;
290-
}
291-
```
292-
293267
- Never name a parameter `arguments`, this will take precendence over the `arguments` object that is given to every function scope.
294268
295269
```javascript

0 commit comments

Comments
 (0)