0

so i’m learning coding from the very beginning and i’m having trouble understanding potential dependencies or needs in pure functions.

I have a workbook that says- remember that pure functions cannot have any side effects. one way to make functions with side effects into pure functions is to use dependencies. in this approach any side effects are placed into function parameters. they can be treated as some other functions responsibility. this is called dependency injection. it can be thought of as a sort of loophole for making impure functions pure.

please could someone help me identify potential dependencies in pure functions? thanks so much in advance!

0 Answers0