before you have to write
makeElement(`h1`)
everywhereafter this declaration you can write
h1()
insteadjust a shortcut function
makeElement(`h1`)
everywhereafter this declaration you can write
h1()
insteadjust a shortcut function
const h1 = () =>
Is this new syntax declaring a function named h1 that returns a function or what? I don't understand what the empty pair of parentheses means. const h1 = function() {
return makeElement('h1');
}
Arrow functions without arguments need empty paranthesis.They also have an implicit return if you don't use {}
So it's not just a syntactic shorthand but there's also a semantic difference.