1.

Why is a closure template used?(a) Statically updating in JavaScript(b) To increase the efficiency and convenience(c) Dynamically generating HTML in Java and JavaScript(d) Changing codeThe question was asked in quiz.The doubt is from The Closure Compiler in section Caching, Debugging and Animation of JavaScript

Answer»

Right option is (c) Dynamically generating HTML in Java and JavaScript

The BEST explanation: Instead of compiling from a source language to MACHINE code, closure TEMPLATES COMPILES from JavaScript to better JavaScript. Closure compiler provides with the basic facilities of removing spaces and dead code. Closure Templates are a templating system for dynamically generating HTML in both Java and JavaScript. Because the language was apparently referred to as “Soy” internal to Google, and “Soy” remains in some of the documentation and classes, sometimes Closure Templates are referred to as “Soy Templates”.



Discussion

No Comment Found

Related InterviewSolutions