結果 : how to avoid nested ternary operator in javascript