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
If by 'named', you mean you want the .name property of your arrow function to be set, you're in luck.
If an arrow function is defined on the right-hand-side of an assignment expression, the engine will take the name on the left-hand-side and use it to set the arrow function's .name, e.g.
var sayHello = (name) => {
console.log(name + ' says hello');
}
sayHello.name //=== 'sayHello'
Having said that, your question seems to be more 'can I get an arrow function to hoist?'. The answer to that one is a big ol' "no", I'm afraid.