結果 : how to return null if array is empty in javascript