examples when.js