语法: () => { … } // 零个参数用 () 表示; x => { … } // 一个参数可以省略 (); (x, y) => { … } // 多参数不能省略 (); 当我们使用箭头函数时,函数体内的this对象,就是定义时所在的对象,而不是使用时(执行时)所在的对象。并不是因为箭头函数 ...
分类:
其他好文 时间:
2017-04-10 14:29:28
阅读次数:
124
1、首先安装babel-cli(用于在终端使用babel) 2、然后安装babel-preset-es2015插件 注:Babel5版本默认包含各种转换插件,然而Babel6.x相关转换插件需要自己下载,如transform-es2015-arrow-functions、transform-es20 ...
分类:
其他好文 时间:
2017-04-04 09:41:01
阅读次数:
212
一.babel转换器:babel.js.io; 二.变量声明. 1.块级作用域let: 2.常量const:一旦声明不可改变,一般用来引入模块,例如:const moment=require("moment"); 三.类Class 四.箭头函数arrow function 1.简化写法 2.使用箭头 ...
分类:
其他好文 时间:
2017-04-02 00:35:52
阅读次数:
160
[452] Minimum Number of Arrows to Burst Balloons[Medium] 给一堆线段,使用最少的arrow,穿过所有的线段。陈题,第一条线段的终点。 1 // 陈题。 第一条线段的终点。 2 //wyzhang 3 class Solution { 4 pub ...
分类:
其他好文 时间:
2017-03-28 22:03:53
阅读次数:
164
Basic Combo - jQuery EasyUI Demo Basic Combo Click the right arrow button to show drop down panel that can be filled with any content. ... ...
分类:
其他好文 时间:
2017-03-23 01:12:23
阅读次数:
152
=>是es6语法中的arrow function 举例:(x) => x + 6 相当于 可以利用map方法 将数组中的每个元素进行处理 ...
分类:
其他好文 时间:
2017-03-10 13:06:55
阅读次数:
169
let arrowImage = UIImageView(image: UIImage(named: "Machine_arrow")!.imageWithRenderingMode(.AlwaysTemplate)) let arrowButton = UIButton(frame: CGRect ...
分类:
编程语言 时间:
2017-02-24 13:39:07
阅读次数:
315
最近经常看到 JS中=>,符号,于是查了一下别人的博客 =>是es6语法中的arrow function 举例:(x) => x + 6 相当于 ...
分类:
Web程序 时间:
2017-02-21 11:44:27
阅读次数:
495
研究博客园注册博客,选择皮肤时发现每个div加了这个方法 <div ondblclick="SetSkin('arrow')"> <img src="a.img" /> </div> ...
分类:
数据库 时间:
2017-01-20 11:30:11
阅读次数:
246
箭头函数:Arrow Function 1:在ES6里面新增了箭头函数:x => x * x 相当于function (x) {return x * x;} 2:箭头函数相当于匿名函数,并且简化了函数定义。箭头函数有两种格式,一种像上面的,只包含一个表达式,连{ ... }和return都省略掉了。 ...
分类:
其他好文 时间:
2017-01-14 15:46:55
阅读次数:
180