js return undefined on ReferenceError

JavaScript
window.console && console.log(new Date());

Source

Also in JavaScript: