Dave's Brain

Browse - Programming Tips - How can I print from the command line js (javaScript) interpreter?

Date: 2016may11
Language: javaScript
OS: Linux

Q.  How can I print from the command line js (javaScript) interpreter?

A.  Use putstr()

#!/usr/bin/js function sayHello() { putstr("hello\n"); } sayHello();
Its called SpiderMonkey. More info https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell To install on RedHat/Fedora/CentOS
dnf install js

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.