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!
You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...
This article serves as a point-by-point...
We've always been able to create links with protocols other than the usual HTTP, like mailto, skype, irc ,and more; they're an excellent convenience to visitors. With mobile phone browsers having become infinitely more usable, we can now extend that convenience to phone numbers: