Replaced all `arr instanceof Array` with `Array.isArray(arr)`