attach .valid methods to array prototype