Create runWhen.js