Why should I use a function if I could just use a var (variable)?


#1

Why should I use a function if I could just use var (variable)? What is the main difference between the two. I find that variables and functions do the same thing.


#2

A variable just holds one piece of data like a string or a number.

A function holds a set of directions that you can reuse with different information.