Function Review


Somehow, I managed to solve the exercise. However, I don't quite understand the instructions and hint given.


Define the function multiply. It should take two parameters, x and y, and return the product.

Then call your function, passing in any two arguments.


Use square as a guide to write multiply. This time, you will have two parameters, and these should be separated by a comma inside the function's parentheses.

To call the function, just type the name of the function, followed by the arguments you want to pass. For example, if we wanted to call square, we would use square(2);

Those that are in bold, I don't really understand. What does it mean to 'call' the function?
And square(2)??

// Accepts a number x as input and returns its square
var square = function (x) {
  return x * x;

// Write the function multiply below
// It should take two parameters and return the product

var multiply = function (x,y)
{ return x*y;}
multiply (5,6)


check it here

if you still have a question then please dont hesitate :slight_smile:


Thanks! Your explanation in the thread really helps! :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.