← All pipes
Collections

unzip

Split paired coordinates into parallel series.

Use it in your component

Standalone component
import { Component } from '@angular/core';
import { JsonPipe } from '@angular/common';
import { UnzipPipe } from 'extra-pipe';

@Component({
  standalone: true,
  imports: [UnzipPipe, JsonPipe],
  template: `{{ pairs | unzip | json }}`,
})
export class ExampleComponent {
readonly pairs = [[1,"A"],[2,"B"]] as const;
}

Template
{{ pairs | unzip | json }}

Try it live.

The output below runs the packed library. Edit data, not code.

Use double quotes for text, or a number, array, object or null.
No parameters: use []. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = [
  [
    1,
    "A"
  ],
  [
    2,
    "B"
  ]
] as const;

{{ value | unzip | json }}

Rendered output

[
  [
    1,
    2
  ],
  [
    "A",
    "B"
  ]
]