Question: I've heard a lot of talk that enabling bitcode decreases the binary size of an app downloaded from the app store onto iOS 9. I haven't been able to find any resources on whether or not bitcode decreases the binary size on previous iOS versions.

Does enabling bitcode decrease the binary size on iOS 7 or iOS 8?

**EDIT**
According to this [thread](https://forums.developer.apple.com/thread/19743) App Slicing and Bitcode are two separate components. This would make sense considering the documentation for [App Thinning](https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/AppThinning/AppThinning.html) splits them into different sections. Is there any official word from Apple on iOS requirements for Bitcode?

Answer: 
There is no such keyword in JavaScript.

In JavaScript variables are available to *all child scopes*, for example:

```
(function() {
  var outerVariable = true;
  (function() {
    console.log(typeof outerVariable); // boolean
    (function() {
      console.log(typeof outerVariable); // boolean
    }())
  }());
}());

```

However, you can't access variables which has been defined in a separate, not-parent scope, for example:

```
(function() {
  var someVariable = true;
}());
(function() {
  console.log(typeof someVariable); // undefined
}());

```

This is the reason why you should write JavaScript code in such a way that you always have access only to variables that you need. Consider following example:

```
(function() {
  var math = (function() {
    // inner variable
    var PI = 3.141592653589793;

    // inner function
    function multiply(...args) {
      return args.reduce((a, b)=> a * b);
    }

    // outer functions
    return {
      circleArea: function circleArea(r) {
        return multiply(r, r, PI);
      },
      circumference: function circumference(r) {
        return multiply(2, PI, r);
      }
    };
  }());

  console.log(math.circleArea(5)); // 78.53981633974483
  console.log(math.circumference(10)); // 62.83185307179586

  console.log(typeof PI); // "undefined"
  console.log(typeof multiply); // "undefined"
}());

```

Inside the IIFE which creates the `math` object, you can use `PI` variable and `multiply` function. The IIFE returns two function, which can access `PI` and `multiply` too, because they are still inside this IIFE. You can call `math.circleArea()` and `math.circumference()` from outside this IIFE, but you can access `PI` or `multiply` — they are `undefined` in this scope.

See also:

* [How do JavaScript closures work?](https://stackoverflow.com/questions/111102/how-do-javascript-closures-work)
* [What is the purpose of wrapping whole Javascript files in anonymous functions like “(function(){ … })()”?](https://stackoverflow.com/questions/2421911/what-is-the-purpose-of-wrapping-whole-javascript-files-in-anonymous-functions-li)
I don't think JS will ever offer what you want. PHP has a strict scope. If I define a variable inside a function it's limited to that function. Likewise, something defined outside that function is not implicitly available inside the function. `use`, like `global` simply changes where and when you can use a variable inside a specific scope.

JS puts everything in the global scope by default. In fact, it's a form of bizarro world, in that you limit a variable's scope to within a function you either have to have it as an argument or explicitly **limit** the scope to that variable

```
function bob(x) {
    // x is implicitly local
    y = 1; //global
    var z = 2; //local
}

```

In other words, all variables in JS are `use` declared implicitly.