Skip to content
Advertisement

In python list comprehensions is there a way not to repeat work

I’m not sure this is needed, since the optimizer might take care of it but the question is about:

JavaScript

both sides need the strip, (just ‘if x’ is not enough).

Advertisement

Answer

I suggest using map:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement