Function parameters part 3

Function Parameters



You can define a single function, and pass different parameter values (arguments) to it.
function sayHello(name) {
alert("Hi, " + name);
}
sayHello("David");
sayHello("Sarah");
sayHello("John");
Try It Yourself

This will execute the function's code each time for the provided argument.

Comments

Popular posts from this blog

Introducing object part 3

Comparison Operators part 2

Module 2