I think Array.isArray(contacts) suffice as with null or undefined it will return false