Uniformly use Array.isArray to test whether an object is an array.

This reads better than manually testing the constructor, and often
leads to terser code since we don't have to check whether the argument
is an non-null object before querying the constructor field.

Change-Id: I53ec87d6e80d658aa3d26dc2b613dc6c58e2d026