The style guide just tries to warn that any `for` at the end of a function will become a map operation so the function returns an array. In this case, the outer loop doesn’t lead to code inefficient code. The inner loop compiles to an IIFE which isn’t nice in my opinion.

Personally I would make both map operations explicit like @mehcode did, I would just add another variable to remove the IIFE.