Template literals

  Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with them. They were called "template strings" in prior editions of the ES2015 specification.

1、syntax

  

2、多行

  

  To get the same effect with multi-line strings, you can now write:

  

3、with template literals, you are able to make use of the syntactic sugar making substitutions like this more readable:

  

4、Tagged template literals

  

5、String.raw()

  The static String.raw() method is a tag function of template literals.It's used to get the raw string form of template strings (that is, the original, uninterpreted text).

  

  

参考:

1、https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals

2、https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw

Template literals的更多相关文章

  1. ES6的一些常用特性

    由于公司的前端业务全部基于ES6开发,于是给自己开个小灶补补ES6的一些常用特性.原来打算花两天学习ES6的,结果花了3天才勉强过了一遍阮老师的ES6标准入门(水好深,ES6没学好ES7又来了...) ...

  2. ES6+ 现在就用系列(二):let 命令

    系列目录 ES6+ 现在就用系列(一):为什么使用ES6+ ES6+ 现在就用系列(二):let 命令 ES6+ 现在就用系列(三):const 命令 ES6+ 现在就用系列(四):箭头函数 => ...

  3. ES6+ 现在就用系列(一):为什么使用ES6+

    系列目录 ES6+ 现在就用系列(一):为什么使用ES6+ ES6+ 现在就用系列(二):let 命令 ES6+ 现在就用系列(三):const 命令 ES6+ 现在就用系列(四):箭头函数 => ...

  4. 漫谈Nuclear Web组件化入门篇

    目前来看,团队内部前端项目已全面实施组件化开发.组件化的好处太多,如:按需加载.可复用.易维护.可扩展.少挖坑.不改组件代码直接切成服务器端渲染(如Nuclear组件化可以做到,大家叫同构)... 怎 ...

  5. 六个漂亮的 ES6 技巧

    六个漂亮的 ES6 技巧 转载 原文:2ality 译文:众成翻译 链接:http://www.zcfy.cc/article/346 在这篇文章里,我将演示 6 种 ES6 新特性的使用技巧.在每个 ...

  6. ES6中的模板字符串和新XSS Payload

    ES6中的模板字符串和新XSS Payload 众所周知,在XSS的实战对抗中,由于防守方经常会采用各种各样严格的过滤手段来过滤输入,所以我们使用的XSS Payload也会根据实际情况作出各种各样的 ...

  7. React.js入门笔记

    # React.js入门笔记 核心提示 这是本人学习react.js的第一篇入门笔记,估计也会是该系列涵盖内容最多的笔记,主要内容来自英文官方文档的快速上手部分和阮一峰博客教程.当然,还有我自己尝试的 ...

  8. Javascript.ReactNative-2-javascript-syntax-in-react-native

    JavaScript Syntax in React Native Contents: Arrow Function Let+Const Default + Rest + Spread Destruc ...

  9. ECMAScript 6十大特性

    ES6入门 http://es6.ruanyifeng.com/ ES6排名前十的最佳特性列表 Default Parameters(默认参数) in ES6 Template Literals (模 ...

随机推荐

  1. (转)centos6.5 bind-DNS服务器bind的搭建详解

    centos6.5环境DNS-本地DNS服务器bind的搭建 域名系统(英文:Domain Name System,缩写:DNS)是因特网的一项服务.它作为将域名和IP地址相互映射的一个分布式数据库, ...

  2. 详解一个ThreadLocal 的谜题

    多线程如果不理解透彻, 那么 ThreadLocal 始终是有些会有所迷糊的. ThreadLocal 本身的命名有有问题, 这些美国精英整出来的技术,再加上一个奇怪的命名.对我们中国人来说,就是一场 ...

  3. Mybatis六(SSM框架)

    SSM三大框架整合详细教程(SPRING+SPRINGMVC+MYBATIS) 使用 SSM ( Spring . SpringMVC 和 Mybatis )已经有三个多月了,项目在技术上已经没有什么 ...

  4. django相关

    后台运行django:https://blog.csdn.net/rnger/article/details/79907884 nohup python manage.py runserver 0.0 ...

  5. out.println与<%!%>的功能一样

    <%! public static final String DBDRIVER = "A"; public static final String DBURL = " ...

  6. new date() 计算本周周一日期

    new date() 计算本周周一日期 需求:计算某天的那一周周一的日期 1.new Date() date.getDay(); //获取周几 0-6 date.getTime();//获取时间戳 1 ...

  7. leetcode315

    public class Solution { public List<Integer> countSmaller(int[] nums) { List<Integer> re ...

  8. VUE.js全局变量的定义

    模块化之后,想用js全局变量,遇到点困难.搜索资料后搞定,大概2个步骤: 1.定义一个vue模块,const定义变量,并用export对外暴露. Globle.vue <script> / ...

  9. c++builder 6 [Linker Fatal error] Unable to open file 'PROXIES.OBJ'

    c++builder 6 [Linker Fatal error] Unable to open file 'PROXIES.OBJ' http://blog.csdn.net/cb168/artic ...

  10. 03_JSX理解和使用

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...