Global Vs. Local Variables


I am just not completely understanding what they are asking so I'm not sure how to get past this lesson. I understand that there is the global variable written but what exactly are they asking me to put inside of the function. I'm getting confused with their use of 'keyword'.

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("Outside the function my_number is: ")


var is a keyword, without it, my_number inside the function will overwrite the global variable


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