Support ES6’s arrow function?

Description

For example,can I transform test1() to test2()?
function test1() {
$(“img”).mouseenter(function(e) {
$(this).css(“opacity”, 0.5);
}).mouseout(function(e) {
$(this).css(“opacity”, 1.0);
});
}

function test2() {
$(“img:odd”).mouseenter(e => {
$(this).css(“opacity”, 0.5);
}).mouseout(e => {
$(this).css(“opacity”, 1.0);
});
}

Link to test case

Author: Fantashit

1 thought on “Support ES6’s arrow function?

Comments are closed.