UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

10 lines (9 loc) 393 B
import { itertoolsChain } from "../_helpers/_itertools.js"; export function chain(...iterables) { // discuss at: https://locutus.io/python/itertools/chain/ // parity verified: Python 3.12 // original by: Kevin van Zonneveld (https://kvz.io) // example 1: chain([1, 2], [3, 4], [5]) // returns 1: [1, 2, 3, 4, 5] return itertoolsChain(iterables); }