Skip to content

Instantly share code, notes, and snippets.

@lennym
Forked from tombooth/gist:9410376
Last active August 29, 2015 13:57
Show Gist options
  • Save lennym/9410401 to your computer and use it in GitHub Desktop.
Save lennym/9410401 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(checkArr(['a']));", context);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment