[javascript] arrow function — Function expression
1 min readMar 14, 2020
arrow function is Function expression.
therefore, it is not allowed Function Hoisting.
Function declaration is allowed Function Hoisting, and it is useful.
but, because Function Hoisting is can be confused for code, using arrow function appropriately is help code concise and work clearerly.
plus(1, 2);function plus(args1, args2) {
return args1 + args2;
}
it works!
plus(1, 2);const plus = (args1, args2) => {
return args1 + args2
}
it’s not allowed!!