Lazy sequence for JavaScript