結果 : if array is empty return 0 javascript