Skip to content

Instantly share code, notes, and snippets.

@tombooth
Created March 7, 2014 12:12
Show Gist options
  • 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