Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Nullish coalescing演算子(??)とOptional chaining(?. #1205

Merged
merged 52 commits into from
Aug 29, 2020

Conversation

azu
Copy link
Collaborator

@azu azu commented Jul 5, 2020

Nullish coalescing演算子(??)とOptional chaining(?.)に関する変更

変更されたページ

変更点

  • falsyの説明を演算子の章に移動
  • Optional chaining演算子の(?.)の解説を"オブジェクト"の章に追加
  • Nullish coalescing演算子(??)とOptional chaining(?.)の組み合わせを説明
  • Nullish coalescing演算子(??)の解説を"演算子"の章に追加
  • 一部のコードを ||?? に置き換え
    • 例としては問題ないけど、?? 推奨気味に変更

追加しなかったこと

  • デフォルト値に対するNullish coalescing演算子(??)とOptional chaining(?.)の組み合わせのパターン
    • 他にもいろいろな書き方があるため含めないようにした
  • 関数呼び出しとOptional chaining演算子(?.
    • window.fn?.() みたいなケース
    • ユースケースがイマイチ。別の解決方法でも良いと思える気がする

fix #1178
fix #1179

@bot-user
Copy link

bot-user commented Jul 5, 2020

Deploy preview for js-primer ready!

Built with commit 82e7c9b

https://deploy-preview-1205--js-primer.netlify.app

source/basic/object/README.md Show resolved Hide resolved
source/basic/object/README.md Show resolved Hide resolved
source/basic/object/README.md Outdated Show resolved Hide resolved
source/basic/function-declaration/README.md Outdated Show resolved Hide resolved
@azu
Copy link
Collaborator Author

azu commented Jul 19, 2020

結構operator周りを書き直してる。

  • falsyをoperatorで説明してる
  • or → and → notの順番に変更 → 戻した
    • and → or → notにしていた
    • falsyを先に出したいから falseである || から

@@ -40,7 +40,7 @@ describe("SUMMARY", function() {
// 許可リスト(読み方の解説など)
const allowFilePathList = [];
const searchPatterns = ["/falsy/gi"];
const falsyChapter = path.join(sourceDir, "basic/implicit-coercion/README.md");
const falsyChapter = path.join(sourceDir, "basic/operator/README.md");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

falsyをoperatorに移動したため、テストも移動。

@azu azu marked this pull request as ready for review July 19, 2020 09:11
@azu
Copy link
Collaborator Author

azu commented Aug 22, 2020

falsyに0n も追加しないとだめか → 追加した

@azu
Copy link
Collaborator Author

azu commented Aug 22, 2020

?? のシンタックスハイライトが変なのはCodeMirrorの問題なのでissueを作った
codemirror/codemirror5#6394

@azu
Copy link
Collaborator Author

azu commented Aug 22, 2020

とりあえずこれでひとまずマージしようかな

source/basic/object/README.md Outdated Show resolved Hide resolved
@azu
Copy link
Collaborator Author

azu commented Aug 29, 2020

マージします。
細かいのは気づいたら治す感じで

@azu azu merged commit 8aaf25b into master Aug 29, 2020
@azu azu deleted the feature/1178 branch August 29, 2020 05:02
@azu azu mentioned this pull request Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ES2020: Optional chaining ES2020: Nullish coalescing Operator
3 participants