From 9c8efcab4e0dec8cc3b9c5ea7fe07f67f60cfaca Mon Sep 17 00:00:00 2001 From: Bent Cardan Date: Thu, 11 Jul 2013 07:01:58 -0400 Subject: [PATCH] reasoning a bit on that solid style --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b2691d682..ce634bed66 100644 --- a/README.md +++ b/README.md @@ -284,7 +284,7 @@ } ``` - - Never name a parameter `arguments`, this will take precedence over the `arguments` object that is given to every function scope. + - Never pass in, nor give the name, `arguments` to a parameter to prevent collision with a local variable. All functions expose an internal `arguments` array-like object containing params passed to functions. ```javascript // bad @@ -294,7 +294,10 @@ // good function yup(name, options, args) { - // ...stuff... + // ...stuff... then if you want go like: + console.log(arguments[0]); // name + console.log(arguments[1]); // options + console.log(arguments[2]); // args } ```