0

I am just curious if there are any difference between using var/let/const to declare arrow function or declare arrow function with out let/var/const.

For example:

hello =()=>{
        console.log('hello')
    }
hello()

let hola = () =>{
        console.log('hola')
    }
   hola()

It seems that that I doesn't use let/const/var won't produce undefined error and no difference, but I saw all the reference resources like MDN and W3school prefer to use let/var/const to declare them?

Is there any performance difference between them and will it cause error if I doesn't use let/var/const to define it?

Thanks for any responds!

James
  • 2,608
  • 2
  • 2
  • 23
  • 1
    The differences between `var`, `const`, and `let` and absence of any are no different for arrow functions than for any other values you would assign to variables. – trincot Dec 29 '21 at 19:47

0 Answers0