JavaScript templating with Mustache.js

Mustache is an open source logic-less template engine developed for languages such as JavaScript, Ruby, Python, PHP, Java and many more. It’s a very lightweight, readable syntax with a comprehensive specification. Mustache can be used for HTML, config files, and source code. It works by expanding tags in a template using values provided in a hash or object. You can use Mustache to render templates anywhere include client side and server side environments.

Organize your JavaScript: The Object Literal

JavaScript is all about objects.

When thinking about JavaScript objects, simply think about groups of key-values pairs (these are sometimes known as “associate arrays” “hash tables” or “hash maps” in other languages). An object literal is a list of zero or more pairs of property names and associated values of an object.