Browse - Programming Tips - How can I output from command-line javaScript?

Date: 2012feb23
Language: javaScript

Q.  How can I output from command-line javaScript?
Such as SpiderMonkey on Linux.

I can not use document.write() or alert() etc

A.  Use print() 

var sum = 3 + 2; print('sum=' + sum);