I don't know how to do the function keyword


#1

var my_number = 7; //this has global scope

var timesTwo = function(number) {
my_number = number * 2;
console.log("Inside the function my_number is: ");
console.log(my_number);
};

timesTwo(7);

console.log("Outside the function my_number is: ")
console.log(my_number);


#2

inside the function, you should make the variable a local variable (so that is only accessible inside the function), which you can by using the var keyword:

var test_function = function(){
  var local_variable = 3; #notice the var keyword, it makes the variable local
}

as you can see in the example above, i used the var word inside the function. Now, use the var keyword to make your my_number a local variable.