Skip to main content
0

Write it once, use it everywhere

Copy-pasting code means copying its bugs too. A function gives a piece of logic a name, so you can call it from anywhere and fix it in one place.