From a20294519e9c98cfb98f45d58d0c771474d248ac Mon Sep 17 00:00:00 2001 From: Stefano Oldeman Date: Fri, 27 Sep 2013 15:42:11 +0200 Subject: [PATCH] CHANGE: Function Declaration examples --- STYLEGUIDE.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index 5f69b12..2475a1f 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -568,6 +568,7 @@ line as if the value is a variable. All other formatting rules listed earlier st - Functions should be declared before they are used. - Function declarations should have the following format: +- also default see jslint style guide ```javascript // Good @@ -575,6 +576,11 @@ line as if the value is a variable. All other formatting rules listed earlier st return arg1 + arg2; } + // Good + doSomething = function (arg1, arg2) { + return arg1 + arg2; + }; + // Bad: Improper spacing of first line function doSomething (arg1, arg2){ return arg1 + arg2; @@ -1147,4 +1153,4 @@ line as if the value is a variable. All other formatting rules listed earlier st # Resources - [ECMAScript 5 Compatibility table](http://kangax.github.io/es5-compat-table/) -- [Annotated ECMAScript 5.1](http://es5.github.io/) \ No newline at end of file +- [Annotated ECMAScript 5.1](http://es5.github.io/)