javascript array helper - every and some