Dave's Brain

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);

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.