
es6
条纹❤格子
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ES6-let和const
let和const 在块区域有效 function test() { for(let i = 1;i<3;i++) { console.log(i) //输出 1 、2 } console.log(i);//输出i is not defined } test(); const 声明的时候必须赋值原创 2019-09-24 11:54:25 · 97 阅读 · 0 评论 -
ES6-字符串操作
{ let str = ‘string’; console.log(str.includes(‘c’));//判断字符串有没有某个字符 false console.log(str.startsWith(‘str’));//判断字符串是不是以某个字符起始 true console.log(str.endsWith(‘ng’));//判断字符串是不是以某个字符结束 true } { let str =...原创 2019-09-24 14:54:18 · 146 阅读 · 0 评论 -
ES6-数值
{ console.log(‘15’,Number.isFinite(15));//判断一个数值是否有尽 true console.log(‘NaN’,Number.isFinite(NaN));//false console.log(‘NaN’,Number.isNaN(NaN));//判断是否不是数字true } { console.log(Number.isInteger(25));//判断...原创 2019-09-24 15:31:44 · 126 阅读 · 0 评论 -
ES6-数组扩展
//遍历数组的下标 for(let index of [1,2.3].keys()) { console.log(index);//0,1,2 } //遍历数组的值 for(let index of [1,2.3].values()) { console.log(index);//1,2,3 //需要引入babel-polyfill } //遍历数组的值和下标 for(let [index,val...原创 2019-09-24 17:55:13 · 127 阅读 · 0 评论 -
ES6-函数扩展
{ //默认值 带默认值的参数放最后 function test(x,y=‘123’) { console.log(x,y); } test(‘000’);//000123 test(‘000’,‘000’);//000000 } { function test2(…argy) //把参数转换为数组 { for(let v of argy) { console.log(v); } } test2...原创 2019-09-24 18:31:53 · 108 阅读 · 0 评论