Skip to content

Instantly share code, notes, and snippets.

@tombooth
Created March 7, 2014 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tombooth/9410376 to your computer and use it in GitHub Desktop.
Save tombooth/9410376 to your computer and use it in GitHub Desktop.
var vm = require('vm');
function checkArr(arr) {
return arr instanceof Array;
}
var context = vm.createContext({
checkArr: checkArr,
console: console
});
vm.runInContext("console.log(checkArray(['a']));", context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment