Tag: Nesting

Why I keep away from nesting closures

[ad_1] Watch “Scale back cognitive load for readers of your code through keeping off nesting of closures” on egghead.io If I come throughout code like this: serve as getDisplayName({firstName, lastName}) { const upperFirstCharacter = string => string.slice(0, 1).toUpperCase() + string.slice(1) go back `${upperFirstCharacter(firstName)} ${upperFirstCharacter(lastName)}` } Likelihood is that, I’m going to refactor it to this: […]

Back To Top