[OpenLayers-Dev] Semicolons

Jeff Dege jdege at korterra.com
Fri Aug 31 10:30:32 EDT 2007


> On Friday, August 31, 2007 9:26 AM, Erik Uzureau wrote:
> To: dev at openlayers
> 
> I prefer:
> 
> function foo() {};
> and
> var foo = function() {};
> 
> whereas s/he prefers:
> 
> function foo() {}
> and
> var foo = function() {}
> 
> do others have an opinion on this? the OC in me wants everything to be
> the same in our code, and I'm more than willing to rollback the
> changes I've just done if people are in favour of the other way of
> doing it.

In the languages I cut my teeth on, this is a function declaration:

 function foo() {}

And this is an assignment statement with an inline function for the rhs:

 var foo = function() {};

And I'm used to semicolon terminators for assignment statements, but 
not for function declarations.

The most important question, though, is what does the language standard 
say?



More information about the Dev mailing list