タグ

ブックマーク / typescript-jp.gitbook.io (1)

  • Null vs. Undefined - TypeScript Deep Dive 日本語版

    コピー/// `foo.bar == undefined` のようなコードを書いたときに、何が起きるか想像してみてください: console.log(undefined == undefined); // true console.log(null == undefined); // true // このようなチェックをすれば、falsyな値について心配する必要はありません console.log(0 == undefined); // false console.log('' == undefined); // false console.log(false == undefined); // false

    Null vs. Undefined - TypeScript Deep Dive 日本語版
    shifumin
    shifumin 2021/11/04
    “結論 TypeScriptチームは、nullを使いません。そして、問題は起きていません。 Douglas Crockfordはnullは良くない考えであり、誰もがundefinedだけを使うべきだと考えています”
  • 1