JavaScript templates and use cases