DEV Community

Discussion on: Extreme Makeover: Code Edition

Collapse
 
buinauskas profile image
Evaldas Buinauskas

Third one! Put PI to function call, you'll have a pure function then. :)

Collapse
 
aspittel profile image
Ali Spittel

Ahh interesting! I normally make my constants global, but could see that being good too!

Collapse
 
buinauskas profile image
Evaldas Buinauskas • Edited

Both approaches are good. Putting const in function would align with functional programming approach. Making function not dependant on anything that's outside of it (being pure) 😊