Template literals
【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的更多相关文章
- ES6的一些常用特性
由于公司的前端业务全部基于ES6开发,于是给自己开个小灶补补ES6的一些常用特性.原来打算花两天学习ES6的,结果花了3天才勉强过了一遍阮老师的ES6标准入门(水好深,ES6没学好ES7又来了...) ...
- ES6+ 现在就用系列(二):let 命令
系列目录 ES6+ 现在就用系列(一):为什么使用ES6+ ES6+ 现在就用系列(二):let 命令 ES6+ 现在就用系列(三):const 命令 ES6+ 现在就用系列(四):箭头函数 => ...
- ES6+ 现在就用系列(一):为什么使用ES6+
系列目录 ES6+ 现在就用系列(一):为什么使用ES6+ ES6+ 现在就用系列(二):let 命令 ES6+ 现在就用系列(三):const 命令 ES6+ 现在就用系列(四):箭头函数 => ...
- 漫谈Nuclear Web组件化入门篇
目前来看,团队内部前端项目已全面实施组件化开发.组件化的好处太多,如:按需加载.可复用.易维护.可扩展.少挖坑.不改组件代码直接切成服务器端渲染(如Nuclear组件化可以做到,大家叫同构)... 怎 ...
- 六个漂亮的 ES6 技巧
六个漂亮的 ES6 技巧 转载 原文:2ality 译文:众成翻译 链接:http://www.zcfy.cc/article/346 在这篇文章里,我将演示 6 种 ES6 新特性的使用技巧.在每个 ...
- ES6中的模板字符串和新XSS Payload
ES6中的模板字符串和新XSS Payload 众所周知,在XSS的实战对抗中,由于防守方经常会采用各种各样严格的过滤手段来过滤输入,所以我们使用的XSS Payload也会根据实际情况作出各种各样的 ...
- React.js入门笔记
# React.js入门笔记 核心提示 这是本人学习react.js的第一篇入门笔记,估计也会是该系列涵盖内容最多的笔记,主要内容来自英文官方文档的快速上手部分和阮一峰博客教程.当然,还有我自己尝试的 ...
- Javascript.ReactNative-2-javascript-syntax-in-react-native
JavaScript Syntax in React Native Contents: Arrow Function Let+Const Default + Rest + Spread Destruc ...
- ECMAScript 6十大特性
ES6入门 http://es6.ruanyifeng.com/ ES6排名前十的最佳特性列表 Default Parameters(默认参数) in ES6 Template Literals (模 ...
随机推荐
- mysql-5.5.50-winx64
1.help 2.Service 3.Configure 4.User 5.design last 1.获取帮助文档 cd C:\Program Files\mysql\mysql-5.5.50-wi ...
- mvn install 打包
mvn install 打包的时候 特别注意下.文档注释. 如果接口上面有这样的注释. mvn install 安装的时候是会报错的. 会有类似的提示. 完整命令: mvn clean install ...
- 重识linux-linux的新增与删除用户组和切换命令
重识linux-linux的新增与删除用户组 1 相关文件 /etc/group /etc/gshadow 2操作相关 groupadd group1 groupmod group1 groupdel ...
- python3基础:基本语句(2017)
http://www.cnblogs.com/qq21270/p/4591318.html 字符串.文本文件 http://www.cnblogs.com/qq21270/p/7872824.htm ...
- sql(Oracle)优化之索引
原文:https://www.cnblogs.com/oraclestudy/articles/5779210.html 建立索引的目的是:l 提高对表的查询速度:l 对表有关列的取值进行检查. 注意 ...
- QT中控制台程序运行问题
环境: ubuntu14.04 问题与解决方法: QT中的控制他程序,默认运行方式是直接输出到Output窗口中来.我的程序需要从控制台输入,这时候默认的运行方式就不行了.通过设置工程全选项让它在终端 ...
- c++Builder debug DataSet Visualizer
c++Builder debug DataSet Visualizer delphi 正常,c++builder报错. fdMemTable->SaveToFile("d:\\DSdb ...
- Centos 7 安装 sphinx2.2 (转)
一.首先到Sphinx官网找到下载地址:http://sphinxsearch.com/downloads/release/如果你比较懒,好吧:http://sphinxsearch.com/file ...
- 阅读程序 回答问题——FindTheNumber
阅读程序 回答问题——FindTheNumber 阅读下面程序,请回答如下问题:问题1:这个程序要找的是符合什么条件的数?问题2:这样的数存在么?符合这一条件的最小的数是什么?问题3:在电脑上运行这一 ...
- WebAssembly相关
git搜索:https://github.com/search?q=WebAssembly 相关demo:https://github.com/jpmorganchase/perspective we ...