User-Defined Functions in JavaScript

Offered By
Coursera Project Network
In this Guided Project, you will:

Describe the purpose of a function in JavaScript.

Create and call a JavaScript function.

Demonstrate reusability in regard to JavaScript functions.

Clock2 hours
IntermediateIntermediate
CloudNo download needed
VideoSplit-screen video
Comment DotsEnglish
LaptopDesktop only

By the end of this project you will have created and used a function in JavaScript. You will use the Notepad++ editor to write both internal and external JavaScript functions and the code to call them from within an HTML file. Through hands-on practice you will compare methods and functions and look at built-in functions versus user-defined functions. Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

Skills you will develop

JavaScript FunctionsFunction CallsMethods versus FunctionsReusabilityBuilt-in Functions

Learn step-by-step

In a video that plays in a split-screen with your work area, your instructor will walk you through these steps:

  1. Define the term function, compare functions and methods, and explain how a function is used in a program.

  2. Examine examples of JavaScript built-in functions and user-defined functions.

  3. Define an internal JavaScript function and call that function from the HTML file where it lives.

  4. Define a function in an external file and link to it from an HTML file.

  5. Demonstrate the process of using the same JavaScript function more than once in a script.

How Guided Projects work

Your workspace is a cloud desktop right in your browser, no download required

In a split-screen video, your instructor guides you step-by-step

Frequently asked questions

Frequently Asked Questions

More questions? Visit the Learner Help Center.