node.jsframework, for example.
node.jsfor server-side web programming, or for command line applications.
How do I even get started?
In a web browser
<script> element, like this:
<!DOCTYPE html> <html> <head> <script> /* Your code goes here */ </script> </head> <body> <p>This is a web page</p> </body> </html>
You can create that file with an
.html extension in any editor, and then open it with any browser. You don’t need any kind of server, or special account, or anything. You can do it on any computer where you have an editor (e.g. WordPad, TextEdit, etc. though something like vim, emacs or SublimeText is probably better since it will do syntax highlighting and auto-indentation.)
If you work on a CSIL machine, and/or if you install “node” on your own computer, then you can use the
Here’s a sample of that from CSIL. Note that
console.log is sort of like a “print” function, but since it’s return value is undefined, we see the value
undefined after each invocation of
console.log (after its does its job of printing something.)
-bash-4.3$ node > console.log("Hello World") Hello World undefined > console.log(2 + 2) 4 undefined > "foobar".toUpperCase() 'FOOBAR' >