Lazy List in JavaScript