原先模式:
hello = function() { return "Hello World!"; }
箭头模式:
hello = () => { return "Hello World!"; } //再变 hello = () => "Hello World!"; //有参数,再变 hello = (val) => "Hello " + val; //最终变 hello = val => "Hello " + val;
2021-08-03 10:04:50
原先模式:
hello = function() { return "Hello World!"; }
箭头模式:
hello = () => { return "Hello World!"; } //再变 hello = () => "Hello World!"; //有参数,再变 hello = (val) => "Hello " + val; //最终变 hello = val => "Hello " + val;