1

In a lot of javascript code let is used to create a function expression. It seems to make more sense to use const since almost always the variable holding the function almost never changes.

Are there any drawbacks for using const instead of let ?

(ps. I have to teach javascript, and I like to use "best practices" when explaining concepts)

The Bartman
  • 156
  • 2
  • 5
  • Does this answer your question? [Proper use of const for defining functions in JavaScript](https://stackoverflow.com/questions/33040703/proper-use-of-const-for-defining-functions-in-javascript) – lastmaj Oct 03 '20 at 12:15
  • "*In a lot of javascript code `let` is used to create a function expression*" - citation needed. – Bergi Oct 03 '20 at 16:46
  • 1
    Are you talking about arrow function expressions or actual `function`s? For the latter, function declarations are still best practice. – Bergi Oct 03 '20 at 16:47

0 Answers0