title: How to convert RxJS triple 'of(...).pipe.map(...)' expression to the Observable of three dimensional array
body: <p>I have this expression:</p>
  <pre><code>var s2 = of(6, 16, 26).pipe(
      map(v1=&gt;of(5, 15, 25).pipe(
        map(v2=&gt;[v1,v2])
        )), 
      combineLatestAll());
    s2.subscribe(console.log)
  </code></pre>
  <p>... and s2 is an of type <code>Observable&lt;number[][]&gt;</code>as I want it.</p>
  <p>Can I convert the following expression in a similar way to <code>Observable&lt;number[][][]&gt;</code> (instead of it being an <code>Observable&lt;Observable&lt;number[]&gt;[]&gt;</code>):</p>
  <pre><code>var r2 = of(5, 15, 25).pipe(
      map(v1=&gt;of(6, 16, 26).pipe(
        map(v2=&gt;of(7, 17, 27).pipe(
          map(v3 =&gt; [v1,v2,v3])
          )))),
      combineLatestAll());
  
     //Print the output:
      r2.subscribe(e1 =&gt; {
    e1.forEach(e2 =&gt; {
      e2.subscribe(e3 =&gt; {
        console.log(e3);
      });
    })
  });
  </code></pre>
  <p>I can't get my head around it. Any help appreciated.</p>
  <p>Solution suggested by Ruth:</p>
  <pre><code>let s3: Observable&lt;number&gt; = of(5, 15, 25);
  let s4: Observable&lt;number&gt; = of(6, 16, 26);
  let s5: Observable&lt;number&gt; = of(7, 17, 27);
  
  const r1 = s3.pipe(
    map((v3: number) =&gt;
      s4.pipe(
        mergeMap((v4: number) =&gt;
          s5.pipe(
            reduce((acc: number[][], v5: number, i5: number) =&gt; {
              acc[i5] = [v3, v4, v5];
              return acc;
            }, [])
          )
        )
      )
    ),
    combineLatestAll()//reduce((acc: number[][], curr: number[][]) =&gt; [...acc, curr], [])
  )
  r1.subscribe(console.log);
  </code></pre>