Syntax problem


#1

https://www.codecademy.com/courses/javascript-beginner-en-6LzGd/1/2?curriculum_id=506324b3a7dffd00020bf661#

Oops, try again. There was a problem with your syntax.
i don't understand statement 2!

// Parameter is a number, and we do math with that parameter
var timesTwo = function(number) {
    return number * 2;
};

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

#2

remove this improper function,

and your code should work just fine :slight_smile:


#3

i don't understand u. can u show me an example?


#4

Your code will work without the above function meaning it should just be,

// Parameter is a number, and we do math with that parameter
var timesTwo = function(number) {
    return number * 2;
};

// Call timesTwo here!
timesTwo(8);

#5

it still doesn't work!


#6

what error are you getting?


#7

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