Skip to content

Instantly share code, notes, and snippets.

@anonrose
Created September 2, 2018 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonrose/8aba042eabe6b65a8bcd8d0cf1dedc4c to your computer and use it in GitHub Desktop.
Save anonrose/8aba042eabe6b65a8bcd8d0cf1dedc4c to your computer and use it in GitHub Desktop.
DisguisedMysteriousNormalform created by anonrose - https://repl.it/@anonrose/DisguisedMysteriousNormalform
let prom = new Promise(res => {
res(5)
});
let assign = function(scope, variableName) {
return (result) => {
scope[variableName] = result;
}
}
class Foo {
constructor() {
prom.then(assign(this, 't'));
}
}
foo = new Foo();
setTimeout(() => {
console.log(foo.t)
}, 50)
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment