結果 : check condition for each element in array javascript