Practice
JavaScriptData StructuresReactConcepts
Sign in
← Back to problems

Multiply (Function Declaration)

Fundamentals: Part 2easy

Course · Section 3: JavaScript Fundamentals – Part 2 · Lecture 34: Functions

Write a function declaration `multiply(a, b)` that returns the product.

Sample tests

Input: multiply(3, 4)
Output: 12
Input: multiply(0, 5)
Output: 0

+ 1 hidden test run on Submit.

Hints

Common pitfalls
  • Logging the result instead of returning it.
Approach & explanation (try first)

A basic function declaration that returns a * b.

Loading...
⌘/Ctrl + Enter

Run your code to see results.