メインコンテンツまでスキップ

文と式

課題01
三項演算子

以下のコードを三項演算子をを使って書き換えてください。

const f = x => {
if (x === 1) {
return 'a';
} else {
return 'b';
}
}