13/33 help stuck


#1

Please HELP ME 13/33 INTRODUCTION SYNTAX ERROR!!

is this right?

var multiply = function (x,y) {
    return x  y;
};
multiply(6,7); / 42

please get back to me as quicly as you can


#2

Missing math operator, *.

x * y

#3

thanks man that helped


#4

but now the code is showing up as white and i also got rid of the / and the 42 at the end, but when it is white it won't work for some reason

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


#5

so it would help if you reply because i cont't do anything while the code turns white instead of multicoloured :frowning:


#6

The output is not from your function, but the console response to the last executed command. Log your result to see the actual output.

console.log(multiply(6, 7))

#10

when i close the browser it still dosen't work for some reason and i have tried it a lot of times. But i like your thinking


#11

are you still on mtf


#12

and i have tried to log out and back in again


#13

Do not use the erroneous code previously suggested and deleted.

Your function should NOT call itself. That will be an infinite loop.

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

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

#14

i have tried to stop that and i have put in now

var multiply = function (x,y) {
multiply (6,7);
}


#15

and

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

at the end separately, not in the same code


#16

but they stilll don't work


#17

This is an infinite loop. A function that calls itself is called recursion, but there is a set of rules that the function must follow. We do not cover the concept here since it can lead to so many crashes. Examine my last post, above.


#18

that still dosen't work i really don't know what is going on


#19

I really don't know what to say. We've spelled it out to you. Now it is somebody else's turn, since I don't seem to be much help. Happy coding!


#20

sorry to disturb you


#21

Not at all. There will come a day I could be more helpful.


#22

can you please post a full screenshot?


#23

@oggy10jack you have a function, multiply, that takes 2 parameters: x and y. Inside your function, you need to return the value of x times y. Then, from outside your multiply function (on line 4 or 5), you need to log the result of multiply(6, 7) to the console.