we actually don't know if p is a number or an array but I can reuse a typeof(p) == 'array' test to make the intent more explicit