DEV Community

Discussion on: When to use LET or CONST

Collapse
 
diek profile image
diek

If the object is the same instance than before, it is not better to update it persé, it depends, the garbage collector will delete unused pointers so no pain in reassign it, depending of the application making an update/copy method can be so much elaborated, even more if you are receiving info fetching api requests.
I do the same as Curtis, always const until i need to reassign the variable.