A little while ago, I posted this here on Hashnode: hashnode.com/post/extending-nodelist-cik8f7sur01o…
I've been putting some time into this and managed to make a little library that does some basic jQuery stuff.
It's far from perfect, but it's mainly a learning project anyway.
I think it's cool to see if I can improve it to actually be something that can be used on production level.
Since I'm no Javascript guru, I reckon there's a lot of stuff that can be improved, so I need your constructive feedback on this. :)
Github: https://github.com/robertvanderelst/r.js
Demopage: http://lab.robertvanderelst.nl/r/r.html
p.s. I feel kinda scared showing this to you all, mainly because I'm not that good at Javascript. Sometimes it's good to get outside of my comfortzone and see where it takes me ;)
Update: .find(), .prev(), .next() and .parent() are now on the demopage, added a changelog and disclaimer :)
The name is somewhat misleading since R is already a programming language for statistical analysis (I though you ported the whole R language to JS), see R Programming Language)
Otherwise the library looks great and is very minimalistic, perfect for bandwidth sensitive applications!
@Robert, that's some really great work! Don't worry, you'll learn as you write more, and more.
Honestly, I am really in love with this idea of learning by making a library. I remember creating a crypto library for learning the implementations.
Don't worry about the quality. We'd love to help you out, and with that note, I have forked it, and will try, and improve your already awesome code-base! 😉
Try implementing the AJAX part. That's where the fun stuff really is. Also try node traversing; you'll get a good idea about recursion, and optimisation. 😃
Hi, this is looking good. I like the structure and clarity of your code.
Just looked at a couple of methods - do you mind a comment or two ?
if (className.indexOf(' ') !== 0) {
var arr = className.split(' '), i = 0;
for (i; i < arr.length; i++) {
i) perhaps no need to use strict equality since indexOf returns an int ?
ii) if the class is an empty string, the test will return -1 and you'll enter the loop - perhaps not intended ?
iii) var s = 'onlyoneword', a = s.split(' '); a is now an array with a single element - so perhaps no need for the indexOf test, but instead test string length ?
Dong Nguyen
Web Developer
I also had my own js library (BellaJS) to handle the regular tasks by my way, so I can say that is the great way to improve JS coding skill.
Here are some experiences on what you should do next:
Just my two cents.