use of template js