This is certainly an improvement over mine, which was too hastily done, but is the middle condition really necessary `Array.isArray(a.data)`? A non-array `a.data` will likely not pass the `a.data.length > 0` condition, unless `a.data` is a string or something.