Skip to content

Instantly share code, notes, and snippets.

@nndnha
Forked from myshov/function_invocation.js
Created June 19, 2017 03:16
Show Gist options
  • Save nndnha/a747bdfca83f092b7d6279924961ad26 to your computer and use it in GitHub Desktop.
Save nndnha/a747bdfca83f092b7d6279924961ad26 to your computer and use it in GitHub Desktop.

Revisions

  1. @myshov myshov revised this gist Apr 2, 2017. No changes.
  2. @myshov myshov created this gist Apr 2, 2017.
    11 changes: 11 additions & 0 deletions function_invocation.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    console.log(1);
    (_ => console.log(2))();
    eval('console.log(3);');
    console.log.call(null, 4);
    console.log.apply(null, [5]);
    new Function('console.log(6)')();
    Reflect.apply(console.log, null, [7])
    Reflect.construct(function(){console.log(8)}, []);
    Function.prototype.apply.call(console.log, null, [9]);
    Function.prototype.call.call(console.log, null, 10);
    new (require('vm').Script)('console.log(11)').runInThisContext();