Functions are central in JavaScript. We’ll learn about functions with a few different examples.
To run this JavaScript code, you can save it in a file (e.g., functions.js) and run it using Node.js:
There are several other features to JavaScript functions. One is the ability to return multiple values using arrays or objects, which we’ll look at next.