I need help on number 7


#1

Hello guys.
i need help with this code.
i don't understand the instruction.
// Parameter is a number, and we do math with that parameter
var timesTwo = function(number) {
return number * 2;
};

// Call timesTwo here!
var timesTwo = function(memo) {
console.log(timesTwo);
}; timesTwo(8);


#2

Hey @boardpro72718! When you call timesTwo. Your suppose to do it like this:

timesTwo(8).

Instead of this:

You dont need to create another function.


#3

sorry, I still can't understand


#4

Bro, Instead of

Change that to: timesTwo(8).....


#5

What @amanuel2 is trying to say is that you don't need to reinvent the wheel here. This exercise is mostly to show you how things work so in this case you just need to call the function and print the value:

console.log(timesTwo(8));

or

var newNumber = timesTwo(8);
console.log(newNumber);

As said the important thing here is to see how things work how a change in the input changes the output how number in the function is used aso just play around with this a bit.


#6

Guys, I don't understand this syntax.
please, help me take it.

var newNumber = function(timesTwo){
console.log(newNumber);
};
timesTwo(8);


#7

Change the function name newNumber to timesTwo. So like this

var timesTwo= function(newNumber){
console.log(newNumber*2);
};
timesTwo(8);

#8

Error
Oops, try again. It looks like you didn't print out the value of newNumber

var timesTwo = function(newNumber) {
console.log(newNumber * 2);
};
timesTwo(8);


#9

Oh sorry i was just giving you a concept. In this particular exercise your suppose to return the newNumber*2. And you need to create a variable called newNumber so like this(Just giving you a tip. The concept is the most important stuff. Instructions arent, when you maybe someday become a programmer you wont have instructions. You basically have a goal and you have to fight your self to achieve that goal by your-self):

var timesTwo= function(number)
{
 return number*2;   
};
var newNumber=timesTwo(5);
console.log(newNumber);