Understanding Functions
A function is lines of code that you call from other places in your code to execute certain things. They're used far and wide, mostly when there's code you want to execute many times.
function myFunc(arguments) {
// function code
}function add(a, b) {
return a + b;
}function log(type, message) {
console.log(`[${type}] ${message}`);
}Last updated