This article's content
Quicktip: Destructuring

To re-assign destructured values to let-variables, you must surround the destructuring in parentheses.

describe("Test", () => {
  let connection: MongoClient;
  let db: Db;

  beforeAll(async () => {
    ({ connection, db } = await createMongoEnvConnection());
  // ...

About Author

Mathias Bothe To my job profile

I am Mathias, born 40 years ago in Heidelberg, Germany. Today I am living in Munich and Stockholm. I am a passionate IT freelancer with more than 16 years experience in programming, especially in developing web based applications for companies that range from small startups to the big players out there. I am founder of, creator of the security service platform BosyProtect┬ę and initiator of several other software projects.