DEV Community

Discussion on: Who was that masked variable?

Collapse
 
khuongduybui profile image
Duy K. Bui

Not really masking, but I have used this feature to safely reuse the variable name, such as

parentArray.forEach((entity) => {
  // do a lot of things with entity
  const something = aTotallyIrrelavantArray.map((entity) => entity.someQuickTransformation());
  // do more things with original entity
}