4 ms·
Should it be mutable or not? Seems reasonable to answer up front by choosing const or let. What are other considerations?
by grajaganDev 2y ago
Should it be mutable or not? Seems reasonable to answer up front by choosing const or let.
What are other considerations?
- NotAnOtter 2y agoAfter thinking about it a bit more, I think I am actually on your side. I previously claimed to be on "Const when things should never locally change". But thinking through the example function expectedRevenuePerAttempt() { (const/let) successRate = success / attempt; return successRate * revenuePerSuccess } I would prefer to use const there.