1 answer
Best Answer
A reusable block of code that performs a task.
Example:
Benefits: Code reuse, modularity, organization.
Example:
function add(a, b) {
return a + b;
}add(2, 3); → returns 5Benefits: Code reuse, modularity, organization.