Question: How can I re-use the variable y in function two? I have read about this topic but what is the simplest solution? 

```
function one(){
    y = 2 
}

function two(){
    x = y * 2 
}​

```

Answer: 
The most literal way of doing what you asked for is to put them inside another function, which you call as soon as you declare it (note the `()` after the `}` closing the function), and declare the variables in the new function's scope. Both of the inner functions would be able to see and modify their values.

You would also need to declare the variables that contain the inner functions themselves *outside* of the wrapper function, so they're visible to code that wants to call them.

```
var one, two;

(function() {
  var x, y;

  one = function() {
    y = 2;
  };

  two = function() {
    y = y * 2;
  };
}())

one();
two();

```

Another common approach would be to use an object and its properties instead of variables:

```
var myObject = {
  one: function() {
    this.y = 2;
  },
  two: function() {
    this.x = this.y * 2;
  }
}

myObject.one();
myObject.two();

```
Declare global variable to use in other function like

```
var y=0;
function one()
{
    y=2 

}

function two()
{
    x=y*2 
}​

```