Difference between a program and a function

Hello,

i can’t properly get the difference between a program and a function.

As said in the exercise:
drawName() is a set of repeatable code that we’ve defined elsewhere called a function . We can call the function, or ask the program to run that code, and pass in different values to see different responses.

Sorry for revamping this old topic! :smile:

Hello.
The program is the entire set of code, including all functions and things like that. A function is the specific set of code, which you define like this:

function functionName(param){
//code
}

And you call (use) like this:

let variableForFunction = functionName(paramToCall)

Basically, functions are code that either you make, or JavaScript has already built in, that can do things, and be reused easily. The program is the whole code.
I hope this helps!