Useful Array Tricks

When you scratch beyond the surface of what arrays are capable of, you enter into some unchartered territory - even if what you are doing seems very reasonable. In this short tutorial, let's chart the unknown and look at how you would accomplish some common array-related tasks such as:

This is a companion discussion topic for the original entry at

You’re better off using isArray to check for arrays rather than going the notoriously unreliable constructor property. :wink:

1 Like

Oh wow! I never heard of isArray until you just pointed it out. It turns out to be supported in all browsers as well!!! #mindblown


I added a few more tricks today! Just wanted to bump this up :slight_smile:

1 Like