ES6 JavaScript template literals - What they can and can't do
问题 Template literals make string manipulation much easier. However: What can and what can't they do in comparison to template libraries such as mustache and handlebars? I found it difficult to find an answer to these questions: Can they handle conditions? Can they handle loops? Can they handle functions? 回答1: The name is a bit ambiguous, but template literals do not replace template engines. They role is only to provide a more convenient syntax to work with strings. In fact, the objective was to