Better Javascript

#WDSLunch — January 28 2014 March 18 2015

jQuery Soup (aka what not to do)

$('.click').click(function(){});
$('.click').css({'color': 'red'});
$('.click').hover( makeMeCoffee );

 

A Few Lessons I’ve Learned

Closures and Variable Scope. The ‘var’ keyword. When to prefix.

A Few Lessons I’ve Learned:

Namespaces and global objects.

A Few Lessons I’ve Learned:

Namespaces and global objects.

A Few Lessons I’ve Learned:

Think about other devs coming behind you..

A Few Lessons I’ve Learned:

An Aside: The difference between array and objects

Best Practice One-offs:

Best Practice One-offs:

Best Practice One-offs:

Best Practice One-offs:

Demo Time

Click to view demo page.

Resources

More (and advanced) Resources