Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Function with Parameters

// program to print the text
// declaring a function
function greet(name) {
    console.log("Hello " + name + ":)");
}

// variable name can be different
let name = prompt("Enter a name: ");

// calling function
greet(name);
 
PREVIOUS NEXT
Tagged: #javascript #Function #Parameters
ADD COMMENT
Topic
Name
7+5 =