Instantly share code, notes, and snippets.

Embed
What would you like to do?
function fun() {
console.log(this.prop);
}
const ctx = {prop: 1};
fun.apply(ctx);
setTimeout(() => {
fun.apply(ctx);
}, 1000);
const funWithCtx = fun.bind(ctx);
funWithCtx();
setTimeout(funWithCtx, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment