js中 => 的含义

代码2023-03-0874 人已阅来源:网络

=>是es6语法中的arrow function

(x) => x + 6

相当于

function(x){
    return x + 6;
};

详解了解:ES6箭头函数详解