Iterator.concat()
The Iterator.concat() JavaScript method returns an iterator that yields values from a sequence of iterators, exhausting each iterator before moving on to the next.
Overview
The Iterator.concat() JavaScript method returns an iterator that yields values from a sequence of iterators, exhausting each iterator before moving on to the next.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 146 | 146 | 147 | 26.4 | 146 | 26.4 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
JAVASCRIPT
const combined = Iterator.concat(
[1, 2, 3],
new Set([4, 5]),
[6]
);
[...combined]; // [1, 2, 3, 4, 5, 6] Live demo
different type(Set and Array). join
Set and Array join, duplicates getexclude order to akses..
PreviewFullscreen
Use cases
Using Iterator.concat()
The Iterator.concat() JavaScript method returns an iterator that yields values from a sequence of iterators, exhausting each iterator before moving on to the next.
Cautions
- Not supported in older browsers. Verify your target environments before adopting.
Accessibility
- When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.
Related links
Powered by web-features