added js and js/hello

pull/3/head
Igor Chubin 7 years ago
parent 266fe053bb
commit 01aab64d71

@ -0,0 +1,16 @@
// JavaScript is available in most web browsers
// For standalong JavaScript usage
// install Node.js or SpiderMonkey
// Works with web browsers
document.write("Hello world!");
// Works with NJS (0.2.5), Rhino, SpiderMonkey
print('Hello world!');
// Works with JScript
WScript.Echo("Hello world!");
// Works with Node.js
console.log("Hello world!")

@ -0,0 +1,24 @@
# js
#
# JavaScript often abbreviated as "JS", is a high-level, dynamic, untyped, interpreted run-time language.
# It has been standardized in the ECMAScript language specification.
#
# js is a JavaScript shell, part of SpiderMonkey
# to install spidermonkey: (in Debian) apt-get install libmozjs-24-bin
# Run the shell in interactive mode
js
# Run the JavaScript code in the file hello.js
js hello.js
# Run hello.js then drop into the interactive shell
js -f hello.js -i
# See also:
# JavaScript language cheat sheets at /js/
# list of pages: /js/:list
# learn JavaScript: /js/:learn
# JS one-liners: /js/1line
# JS weirdness: /js/weirdness
# search in pages: /js/~keyword
Loading…
Cancel
Save