Created
December 30, 2020 17:04
-
-
Save jfet97/6790e0e96284b4951ab34167304968e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const scope = callback => ({ | |
with: Function(`with(arguments[0])return(${callback})()`) | |
}); | |
scope(() => ['a', test, 'c']).with({test: 'b'}); | |
// ["a", "b", "c"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment