You could also wrap your function with a logger wrapper function. Ending up with something like:
nums.map(logged(num=><likey={num}>{num}</li>))
The function returned by your logged wrapper function would log inputs, outputs, whatever; as well as calling the passed function and returning its result. This way you could have consistent logging everywhere, and switch it off at a stroke just by modifying the logged function
You could also wrap your function with a logger wrapper function. Ending up with something like:
The function returned by your
logged
wrapper function would log inputs, outputs, whatever; as well as calling the passed function and returning its result. This way you could have consistent logging everywhere, and switch it off at a stroke just by modifying thelogged
functionI like this!
If you wanted them fully removed though, you would still need to do that. The wrapped versions of the functions will be slower than the originals