alert
is not a feature of javascript. It's part of the API the browser exposes to JavaScript. And coffee
at the command line on you computer is just a thin wrapper around node.js
that translated coffee script into javascript to be interpreted by node. node.js
does not provide an alert
function. Nor does it provide a global print
function.
Both node, and the browser, do provide a console
object globally. So console.log
works the same.
Brush up on the node docs to learn what function node exposes. And rememebr that just because it works in a browser does not mean it will work in node.