Iterator.concat()
The Iterator.concat() static method creates a new Iterator object from a list of iterable objects. The new iterator yields the values from each of the input iterables in sequence.
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.
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.