In JavaScript ES6 an arrow function expression is a syntactically compact alternative to a regular function expression.
Create a function that takes a string representing a function and converts between an arrow function and a regular function
// Function to arrow
"function () {}" ➞ "() => {}"
"function name() {}" ➞ "const name = () => {}"
"function name(str) { console.log(str); }" ➞ "const name = (str) => { console.log(str); }"
// Arrow to function
"() => {}" ➞ "function () {}"
"const name = () => {}" ➞ "function name() {}"
"let name = (str) => { console.log(str); }" ➞ "function name(str) { console.log(str); }"
const / let / var or nothing at all. However, when converting a regular function to an arrow, always use const (unless you're dealing with an anonymous function).