0

I'm assuming that it depends on the package and whether or not its internal data is changed. I just wanted to make sure because I have seen some package documentation use const and others use var/let and I haven't been able to find any answers to this using google. Right now I'm using let. Would there be any performance improvement from using const on packages that support it?

TheAschr
  • 899
  • 2
  • 6
  • 19
  • 4
    You can and probably should always use `const`. No, it does not depend on the package - it's your local variable. [The package object is still mutable](https://stackoverflow.com/q/42833540/1048572) – Bergi Feb 06 '18 at 14:02
  • By *saved* you mean *imported*? As Bergi notes it, it's not the package which is `const`, it's your variable. – RaphaMex Feb 06 '18 at 14:28

1 Answers1

1

Usual rule is to always use const by default, and only use let when necessary, so for imported package it's almost never.

Gabriel Bleu
  • 9,703
  • 2
  • 30
  • 43