var name new Promise(function(resolve, reject){ setTimeout(function(){ resolve() name = "foo" }) }) .then(function(){ console.log(name) // foo })