Sep 6, 2018 · 1 min read
There are also the cases where const is unavailable because you are using the same value multiple times, for example
if (map.has('key')) return map.get('key')
const generatedVal = extremeComputation('key')
map.set('key', generatedVal)
return generatedValHow would you rewrite this without const, even in several functions?