Joined June 2012
·

Kevin Ennis

Front-End Developer at Aereo
·
Boston
·
·
·

You can also wrap your code in an IIFE and create a local undefined.

(function(window, undefined){
    alert( typeof undefined ); // 'undefined'
}(window)),

@Licenser They don't claim to AVOID callbacks, they abstract them. Callbacks are the whole point of asynchronous programming. These libraries are just trying to mitigate the "hell" part.

And it's worth mentioning that about 90% of the examples I hear of Callback Hell are really just examples of poor coding practices, like nesting 5 levels of anonymous functions.

Async programming is only ugly when it's done by people who don't understand it.

Posted to Random alphanumeric strings in JS over 1 year ago

Nope, I meant what I posted.

The reason for including the date first is to reduce the (admittedly very low) likelihood of collisions between the random strings.

By prefixing the date, you reduce the risk of duplication -- because the colliding hashes would have to have been generated within a millisecond of eachother to actually cause a problem.

Achievements
135 Karma
8,456 Total ProTip Views