Only prints one function instead of two


#1

I have this code:

var square = function (x) {
return x * x;
};

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

square(2);
multiply(3, 12);

When I run the code it only prints the multiply function. Why?


#3

I don't get that. Why ** ?


#4

Hi you code is fine I was wong about ** and if you want to print the square I dont know why but if you put the call of the square function after the multiply it will show the square and not the multiply like that

multiply(3, 12)
square(2)

#5

The coding environment here will display the final value from the program. That is why you are only seeing the results of the multiply function.

If you want to print something, use console.log().