Level 1M3Lesson 3.4

beginner35 minby DevFox

Optional chaining ?. and nullish coalescing ??

Use a value that may be missing with ?., which goes round null and undefined instead of calling a method on them, and give the line a default with ??. See why ?? keeps a real 0 that || replaces, and make TaskKit read, tidy and default its task in one line.

  • Fundamentals
  • TypeScript
Optional chaining `?.` and nullish coalescing `??`. Read this lesson at .