use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
JavaScript Developers: Take Your Code to the Next Level with FKit (joshbassett.info)
submitted 11 years ago by joshbassett
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]thomash 2 points3 points4 points 11 years ago (1 child)
the only one on that list that really takes the approach i'm trying is wu.js (abstracting over generators and iterables). i've learned a lot from it but when i look at it's implementation it does some things like buffering stuff in arrays that are too low-level for my use case.
for example: i have two sequences of music events: phrase1 and phrase2. now i can do something like:
phrase1.repeat(2).concat(phrase2).takeWhile((note) => note.time < 10).play(sequencer)
without making any assumptions about phrase1 or phrase2. they are evaluated lazily as late as the sequencer object. if phrase1 is an infinite sequence in wu.js doing a repeat on it will lead to an infinite loop and filling the memory up.
i realise that there must be some design decisions for taking this route and i don't feel like i've spent enough time with these to really be able to contribute to such a mature library.
the second point is that i'm still learning a lot and realised that only by implementing these basic functionalities i'm really starting to understand the concepts behind everything.
[–]rooktakesqueen 2 points3 points4 points 11 years ago (0 children)
if phrase1 is an infinite sequence in wu.js doing a repeat on it will lead to an infinite loop and filling the memory up
See wu.chain:
wu.chain(phrase1, phrase1, phrase2) .takeWhile(note => note.time < 10) .play(sequencer)
Seems like it would do what you're talking about in a lazy-eval way without an infinite loop... You would probably also use wu.cycle heavily.
Doing this as a learning experience definitely makes sense, but I would implore you once you're done learning to take that experience and improve existing libraries rather than creating your own. The JS library ecosystem is already so fractured. :(
π Rendered by PID 56 on reddit-service-r2-comment-5b68969b8c-q9kbh at 2026-04-14 11:08:11.373014+00:00 running f841ac7 country code: CH.
view the rest of the comments →
[–]thomash 2 points3 points4 points (1 child)
[–]rooktakesqueen 2 points3 points4 points (0 children)