13. Funtcion Review



There was a problem with your syntax.

// 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 function = multiply (x , y)


@appylpye :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused: :confused:


You have ...

var function = multiply (x , y)

It should be ...

var multiply = function(x, y) {

... followed by the rest of the function definition.


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

Make sure to call 'multiply' at least once!


After the function definition, you could call it as follows or with any other two numbers of your choice ...

console.log(multiply(7, 6));