結果 : how to replace nested ternary operator in javascript