myArray = ; // bad
That isn't the optimal way to get a fresh array; to truncate an array, and thus empty it, you should set the length property to zero:
myArray.length = 0; // good!
Setting the length equal to zero empties the existing array, not creating another array! This helps you to avoid pointer issues with arrays as well. With the new array method above:
// ... as provided by Dag in the comments
A = [1,2,3,4,5]
B = A
A = 
console.log(B) // [1,2,3,4,5]
length truncation would make both
B the original array but empty!
attachEvent. Times have changed but there are still a few functions each developer should...
CSS filter support recently landed within WebKit nightlies. CSS filters provide a method for modifying the rendering of a basic DOM element, image, or video. CSS filters allow for blurring, warping, and modifying the color intensity of elements. Let's have...
One subtle detail that can make a big difference on any web design is the use of image reflections. Using them too often can become obnoxious but using reflections on large, "masthead" images is a classy enhancement. Unfortunately creating image reflections within your...
We've all inherited rubbish websites from webmasters that couldn't master valid HTML. You know the horrid markup: paragraph tags with align attributes and body tags with background attributes. It's almost a sin what they do. That's where dwMarkupMarine comes in.