Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 6: Functions in JavaScript!

Instruction

Declaration of Functions

Functions can be constructed in three main ways. The first version can be abbreviated further; see below.

The Conventional Way

"use strict";

// conventional declaration (or 'definition')
function duplication(p) {
 return p + "! " + p + "!";
}
// call the function
const ret = duplication("Go");
alert(ret);

Construction via a Variable and an Expression