Mid JavaScript

What are functions in JavaScript?

Functions are blocks of reusable code that perform a specific task.

Example:

function greet(name) {

return `Hello, ${name}`;

More from JavaScript Tutorial

All questions for this course