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