![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES6
文章平均质量分 74
zangyuechao100
这个作者很懒,什么都没留下…
展开
-
ES6语法(4)
数值扩展一、新增方法1.Number.isFinite() 是否是有限的2.Number.isNaN() is not a number?3.Number.isInteger() 是否是整数Number.isInteger(25); //trueNumber.isInteger(25.0); //true必须传入数字,如果传入的是原创 2017-05-23 15:46:26 · 194 阅读 · 0 评论 -
ES6语法(5)
数组扩展1.Array.of 把一组数据转变为数组 { let arr = Array.of(1,3,4,5,6); console.log(arr); // [1,3,4,5,6] }2.Array.from 当只有一个参数的时,把伪数组转化为数组当有两个参数时原创 2017-05-23 16:10:56 · 199 阅读 · 0 评论 -
ES6语法(3)
字符串扩展一、unicode编码例一 console.log("\u20BB7"); // ₻7(错误) console.log("\u{20BB7}"); //原创 2017-05-23 14:25:25 · 139 阅读 · 0 评论 -
ES6语法(6)
函数扩展一、参数默认值 { function test(x, y="world"){ console.log(x,y); } test("hello"); //hello world test("hello","jack"); //原创 2017-05-23 21:16:40 · 164 阅读 · 0 评论 -
ES6语法(7)
对象扩展一、简洁表达式 { let o = 1; let x = 2; let es6 = { o, x } console.log(es6); //{o:1,x:2原创 2017-05-23 22:00:37 · 223 阅读 · 0 评论 -
ES6语法(8)
Symbol用法Symbol的作用声明独一无二的变量 { let a1 = Symbol(); let a2 = Symbol(); console.log(a1===a2); //false let a3= Symbol.for("a原创 2017-05-24 10:16:28 · 188 阅读 · 0 评论 -
ES6语法(10)
数据结构Map与Array对比Set与Array对比Map与Object对比Set与Object对比一、Map与Array对比数据结构横向对比,增删改查。1.增array,push / array.unshiftmap.set2.查map.has();array.find(item=>item.t); /原创 2017-05-24 12:54:52 · 173 阅读 · 0 评论 -
ES6语法(11)
ES6中的类一、定义类的基本方法 { class Parent{ } }此时定义了一个空的类,没有具体内容。constructor是构造函数,实例化还是用new。 { class Parent{原创 2017-05-24 14:00:52 · 163 阅读 · 0 评论 -
ES6语法(1)
let和const一、let和var的区别let声明的变量只在自己的块作用域有效function text1(){ for(let i=1;i console.log(i); } console.log(i);}text1(); // 1 2 i is not defined原创 2017-05-22 17:57:47 · 127 阅读 · 0 评论