How do I write a named arrow function in ES2015?

前端 未结 8 887
余生分开走
余生分开走 2020-11-22 16:29

I have a function that I am trying to convert to the new arrow syntax in ES6. It is a named function:

function sayHello(name) {
    console         


        
8条回答
  •  不知归路
    2020-11-22 17:12

    No. The arrow syntax is a shortform for anonymous functions. Anonymous functions are, well, anonymous.

    Named functions are defined with the function keyword.

提交回复
热议问题