Master AI & Build your First Coding Portfolio with SkillReactor | Sign Up Now

Lesson 4 - Functions

4.2 Function Parameters

Almost all functions we declare in our regular programming take some input known as parameters. Parameters allow you to share data with a function for processing.

Parameters are specified within the parentheses () when defining the function.

function greet(name) {
    console.log("Hello, " + name + "!");


Here, the function greet() takes a person's name as a parameter and greets them. Try to pass your name.