What are the benefits of using Handlebars.js, or any other such libraries, compared to just using JavaScript? So far I have not found anything in Handlebars that I cant do in just javascript.
JavaScript libraries make it easier and quicker to do things in JavaScript, anything a library can do, you can do yourself in JavaScript. But why would you? In pure JavaScript, if I wanted to select a element by id, I'd have to do this:
document.getElementById("coolId");
Or in JQuery (a JavaScript library) I could just do this:
$("#coolId");
It's quicker and easier than using pure JavaScript. Hence that's why I use JQuery to select elements and why I many different libraries - because they allow me to do things much quicker and easier than doing it myself in pure JavaScript, think of libraries as 'shortcuts' to achieving your goal functionality.
Edit: The drawbacks
However, whilst JavaScript libraries (generally) make our lives easier, as developers. They do come with drawbacks, including; large JavaScript files to download, taking longer for JavaScript engines to execute the code and, therefore, makes our code less efficient. For more on this, here are some links:
Thanks to Lix for the reminder.