DEV Community

Discussion on: Functional programming basics part 1: Pure function

Collapse
 
pizmovc profile image
Luka

I don't think that the void return type has anything to to with function purity. A function can be pure even if it returns some value. It just shouldn't modify anything outside of it and does not use any variables that are defined outside of its scope. Its return value should be determined solely by its input parameters.