Skip to content

Instantly share code, notes, and snippets.

@xnuk
Created June 27, 2014 12:30
Show Gist options
  • Select an option

  • Save xnuk/e7d08e1d45d63ec601f7 to your computer and use it in GitHub Desktop.

Select an option

Save xnuk/e7d08e1d45d63ec601f7 to your computer and use it in GitHub Desktop.
[scopecontrol.js](https://gist.github.com/xnuk/69050c1368cd355b7bea) epic answers
console.log((function(){
var r=Math.random();
(function(){
var r=Math.random();
(function(){
/* A */
console.log(-1);
console.log=function(){};
})()
})()
return r
})())
var func=((function(){
var r=Math.random();
(function(){
var r=Math.random();
(function(){
/* A */
window.setTimeout(function(){
func=-1
},0)
})()
})()
return r
})())
var func=((function(){
var r=Math.random();
(function(){
var r=Math.random();
(function(){
/* A */
Function.prototype.call=function(){
return -1
}
})()
})()
return r
})())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment