DEV Community


Discussion on: Chrome v80 release: JS module support for workers

louis profile image
Louis Augry

Also with v80, you can do optional chaining !

// Less error-prone, but harder to read.
let nameLength;
if (db && db.user &&
  nameLength =;

// Still checks for errors and is much more readable.
const nameLength = db?.user?.name?.length;