What does the precompilation of underscore template mean?

precompiled templates are helpful for debugging unreproducible errors. This is because precompiled templates can provide incorrect line numbers and stack traces, and some templates cannot be compiled on the client (browser). On compiled template functions, there is a source attribute that provides simple precompilation.

  <script>
      JST.project = <%= _.template(jstText).source %>;
  </script>

and I see how source is defined.

template.source = "function(" + argument + "){\n" + source + "}";
Isn"t

source the concatenated string? What does precompilation mean here? What"s the point?

Menu