Hey, I am currently learning Javascript as I cannot seem to escape it with the direction in which web dev is going. :)

Please suggest simple Javascript libraries one can read to improve their knowledge of JS and see it in action. The ideal libraries would have a small well commented(optional) codebase(around 1000 LOC or less) which preferably requires little domain knowledge. It need not even be a library, any JS code which covers a good deal of the language would be ideal. It would be great if it covered things like OOPS, callbacks, promises, prototypal inheritance and also some simpler stuff such as passing functions around as arguments, etc.

Write your answer…

7 answers

Underscore.js / Lodash is probably the closest to what you are looking for. Here's why:

  • small library - check!
  • well commented/ documented - check! (I find lodash to have better comments, but underscore is pretty well commented as well)
  • covers general JavaScript concepts - check!
  • "passing functions around as arguments" - hell yeah!
  • both libraries have awesome documentation

Lodash is a fork of Underscore, but on steroids. Both are great libraries! Learning them and digging deeper in their source code can greatly improve your Javascript knowledge.

Wanna take it one step further? No, problem - pick a random function from the library and rewrite it using your knowledge. After that compare your function with the original one - find the differences and similarities of both, try to understand why their approach is different than yours (if different) and refactor/optimize your function. You can even find a bug or piece of code, which can be further optimized - pull request that son of a btch. If accepted - congratulations, you just contributed to one of the coolest JavaScript libraries!

1 Beer1

Hashnode is building a friendly and inclusive dev community. Come jump on the bandwagon!

  • 💬 A beginner friendly place

  • 🧠 Stay in the loop and grow your knowledge

  • 🍕 >500K developers share programming wisdom here

  • ❤️ Support the growing dev community!

Register ( 500k+ developers strong 👊)

Things that you can get started with. (PS: May not be straight forward, but I hope this list helps you out!)

  • JS Best Practices
  • Read Eloquent JavaScript, for starters.
  • Look into this
  • An excellent video, on how to learn things, not just for JavaScript.
  • I don't wanna sound like an AngularJS fanboy, but yeah, give it a go. Just try to understand what it does, it will help you with how to write organized code.
  • If you really liked AngularJS, and want to know more, this will help. (Yeah, I guess I'm an AngularJS fanboy.)
  • Also, get to know the "What the fuck?" side of JavaScript
  • And finally, go crazy, build anything off your own from what you learn daily, break things, make things, write bad code, learn from them.

Good luck & Happy Scripting!

I learned JS by building GWT and Dart applications, then telling the compiler not to minify the JS, then reading through the JS to see if I understand what's going on. That's probably a lot harder than it needs to be.

Tony Alicea has some excellent JS tutorials, try this YouTube video, if you like it, get the full 12 hour course which will teach you how to write your own JS Libraries: youtube.com/watch?v=Bv_5Zv5c-Ts

In the full course, you will enhance your abilities as a Javascript developer by delving into first class functions, callbacks, closures, IIFEs, prototypal inheritance, diving into the source code of jQuery, and building your own small framework/library.

Thanks! The course looks very promising. will definitely check it out.

Reply to this…

Nicolas Bevacqua is an Argentinian developer, he writes a blog and is the author of some pretty popular open source javascript libraries (Horsey, Dragula, Rome, Insignia). You should read his Javascript quality guide and then read the source code of his different libraries. This article: Designing front end components is also of interest.

Hi Sai. You can also try codeschool if you want to learn by doing. As an Angular dev, i must warn you that if you're not really at ease in JS dev, you better follow some tutorials rather than diving alone into Angular core since it's quite complex. Good luck though ;).

Show all replies

Codeschool might be a good resource, but i have never felt i have truly understood a topic after doing a codeschool course on it. Might not be my cup of tea. True that. that is why I am only focusing on plain JS before learning any frameworks!

Reply to this…

Load more responses