improved duck typing
using built-in isArray function