DEV Community

Discussion on: Simplify foreach loops with the null-coalescing operator

Collapse
 
jayjeckel profile image
Jay Jeckel

It's a neat trick, but all I can see when looking at it is an unnecessary allocation. I guess it comes down to which one finds more annoying, writing an if statement one time or burning extra cpu and memory every time the line of code is run.