ES6
joyour
这个作者很懒,什么都没留下…
展开
-
es6:ES6 中的模板字符串
let sentence = `Hello , my name is ${myname}` 其中 ` 用来定义 ES6 中的模板字符串,${expr} 用来在模板字符串中嵌入表达式。原创 2019-08-01 10:26:02 · 106 阅读 · 0 评论 -
ES6:includes(), startsWith(), endsWith()
includes(), startsWith(), endsWith() includes():返回布尔值,表示是否找到了参数字符串。 startsWith():返回布尔值,表示参数字符串是否在原字符串的头部。 endsWith():返回布尔值,表示参数字符串是否在原字符串的尾部。 let s = 'Hello world!'; s.startsWith('Hello') // t...原创 2019-03-19 14:05:54 · 216 阅读 · 0 评论