'combineLatest with arrays of observables

How would one go about using combineLatest with two or more arrays of observables?

const array1 = [of(1), of(2)];
const array2 = [of(3), of(4)];

combineLatest(array1, array2)
  .subscribe(([array1, array2]) => {
    console.log(
      `array1[0]: ${array1[0]}
      array1[1]: ${array1[1]}
      array2[0]: ${array2[0]}
      array2[1]: ${array2[1]}`
    );
  });

I have a stackblitz: https://stackblitz.com/edit/typescript-cnzvlo?file=index.ts&devtoolsheight=100



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source