Skip to content App logo
WRITE A POST Connect
Notifications
Sign In/Up
Via Twitter
Via GitHub
All about dev.to

re: Initialize a const variable inside a function getting called simultaneously VIEW POST

TOP OF THREAD FULL DISCUSSION
re: the second is better because the first will have to get re-allocated after every call and will never disappear. whereas in the second, you use cons...
 
dylanesque profile image Michael Caveney twitter logo github logo
Mar 23
Permalink Settings Moderate Report Abuse

Agreed, plus the second one reads a little bit cleaner.

DELETE EDIT REPLY
code of conduct - report abuse
Home About Privacy Policy Terms of Use Contact Code of Conduct
DEV Community copyright 2016 - 2019  🔥
Sloan, the sloth mascot

Join our DEV Community :)

We're a place where coders share, stay up-to-date and grow their careers.

Twitter logo Auth With Twitter GitHub logo Auth With GitHub

We strive for transparency and don't collect excess data.

twitter logo github logo