Skip to main content
replaced http://programmers.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

I haven't worked with underscore yet (gasp), BUT, I'd like to give what I can here in case you get no better answer soon!

Readability

Your formatting is nearly flawless. However, Douglas Crockford says:

If a function literal is anonymous, there should be one space between the word function and the ( (left parenthesis). If the space is omited, then it can appear that the function's name is function, which is an incorrect reading.

So if you're alright with some nit-picky feedback, try:

function (item, key, collection)

rather than

function(item, key, collection)

Flexibility

Try breaking down your main function into simpler, sub functions, that each have very specific jobs. This keeps your code decoupled, and extensible. I call this Single Function Function. I learned it here.I learned it here. (Read that, and you instantly evolve as a JavaScript Programmer.)

I haven't worked with underscore yet (gasp), BUT, I'd like to give what I can here in case you get no better answer soon!

Readability

Your formatting is nearly flawless. However, Douglas Crockford says:

If a function literal is anonymous, there should be one space between the word function and the ( (left parenthesis). If the space is omited, then it can appear that the function's name is function, which is an incorrect reading.

So if you're alright with some nit-picky feedback, try:

function (item, key, collection)

rather than

function(item, key, collection)

Flexibility

Try breaking down your main function into simpler, sub functions, that each have very specific jobs. This keeps your code decoupled, and extensible. I call this Single Function Function. I learned it here. (Read that, and you instantly evolve as a JavaScript Programmer.)

I haven't worked with underscore yet (gasp), BUT, I'd like to give what I can here in case you get no better answer soon!

Readability

Your formatting is nearly flawless. However, Douglas Crockford says:

If a function literal is anonymous, there should be one space between the word function and the ( (left parenthesis). If the space is omited, then it can appear that the function's name is function, which is an incorrect reading.

So if you're alright with some nit-picky feedback, try:

function (item, key, collection)

rather than

function(item, key, collection)

Flexibility

Try breaking down your main function into simpler, sub functions, that each have very specific jobs. This keeps your code decoupled, and extensible. I call this Single Function Function. I learned it here. (Read that, and you instantly evolve as a JavaScript Programmer.)

Source Link
user73428
user73428

I haven't worked with underscore yet (gasp), BUT, I'd like to give what I can here in case you get no better answer soon!

Readability

Your formatting is nearly flawless. However, Douglas Crockford says:

If a function literal is anonymous, there should be one space between the word function and the ( (left parenthesis). If the space is omited, then it can appear that the function's name is function, which is an incorrect reading.

So if you're alright with some nit-picky feedback, try:

function (item, key, collection)

rather than

function(item, key, collection)

Flexibility

Try breaking down your main function into simpler, sub functions, that each have very specific jobs. This keeps your code decoupled, and extensible. I call this Single Function Function. I learned it here. (Read that, and you instantly evolve as a JavaScript Programmer.)