Merging arrays is a fairly common occurrence. I remember when I worked a lot with PHP I would use
array_merge() all the time. I found myself merging arrays often when handling form submission.
concat may mess up a reference. If you want to merge a second array into an existing first array, you can use this trick:
var array1 = [1, 2, 3];
var array2 = [4, 5, 6];
console.log(array1); // is: [1, 2, 3, 4, 5, 6]
push in this case, allows you to merge the second array into the first. The alternative is iterating through the second array and using
push on the first array. This shortcut is niiiiiiiiiice!
This article serves as a point-by-point...
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
I'm going to share something with you that will blow your mind: I don't have the MooTools documentation memorized. I just don't. I visit the MooTools docs frequently to figure out the order of parameters of More classes and how best to use...
I'm a big fan of video games. I don't get much time to play them but I'll put down the MacBook Pro long enough to get a few games in. One of my favorites is Portal. For those who don't know, what's...