月: 2021年12月

JavaScript の代入演算子

??= 変数が null または undefined の場合のみ代入処理が行われる。 let a = null; a ??= ‘hello’; console.log(a); // => hello let b = ‘world’; b ??= ‘hello’; console.log(b); // => world let c; c ??= ‘hoge’; console.log(c…続きを読む