結果 : javascript reduce with if statement